Skip to content

Commit

Permalink
バージョンアップデート
Browse files Browse the repository at this point in the history
  • Loading branch information
higashi000 committed Sep 10, 2024
1 parent c3c79da commit 351a3ab
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 12 deletions.
4 changes: 2 additions & 2 deletions denops/kakkonan/main.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Denops } from "https://deno.land/x/denops_std@v3.8.1/mod.ts";
import { load } from "https://deno.land/x/denops_std@v3.8.1/helper/mod.ts";
import { Denops } from "https://deno.land/x/denops_std@v7.0.2/mod.ts";
import { load } from "https://deno.land/x/denops_std@v7.0.2/helper/mod.ts";
import {
backQuote,
backSpaceEnter,
Expand Down
2 changes: 1 addition & 1 deletion denops/kakkonan/mod/bscr.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Vim } from "https://deno.land/x/denops_std@v3.8.1/mod.ts";
import { Vim } from "https://deno.land/x/denops_std@v7.0.2/mod.ts";
import { getLineChar } from "./getLineChar.ts";
import { brackets } from "./brackets.ts";

Expand Down
2 changes: 1 addition & 1 deletion denops/kakkonan/mod/completion.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Denops } from "https://deno.land/x/denops_std@v3.8.1/mod.ts";
import { Denops } from "https://deno.land/x/denops_std@v7.0.2/mod.ts";
import { getLineChar } from "./getLineChar.ts";
import { backQuote, brackets, quotes } from "./brackets.ts";

Expand Down
4 changes: 2 additions & 2 deletions denops/kakkonan/mod/customSurround.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Denops } from "https://deno.land/x/denops_std@v3.8.1/mod.ts";
import { execute } from "https://deno.land/x/denops_std@v3.8.1/helper/mod.ts";
import { Denops } from "https://deno.land/x/denops_std@v7.0.2/mod.ts";
import { execute } from "https://deno.land/x/denops_std@v7.0.2/helper/mod.ts";

export async function customSurroundBrackets(
vim: Denops,
Expand Down
2 changes: 1 addition & 1 deletion denops/kakkonan/mod/delete.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Denops } from "https://deno.land/x/denops_std@v3.8.1/mod.ts";
import { Denops } from "https://deno.land/x/denops_std@v7.0.2/mod.ts";
import { backQuote, brackets, quotes } from "./brackets.ts";

export async function deleteBrackets(vim: Denops): Promise<void> {
Expand Down
2 changes: 1 addition & 1 deletion denops/kakkonan/mod/getLineChar.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Denops } from "https://deno.land/x/denops_std@v3.8.1/mod.ts";
import { Denops } from "https://deno.land/x/denops_std@v7.0.2/mod.ts";

export async function getLineChar(vim: Denops, diff: number): Promise<string> {
const cursorStr = await vim.call("getline", ".") as string;
Expand Down
2 changes: 1 addition & 1 deletion denops/kakkonan/mod/replace.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Denops } from "https://deno.land/x/denops_std@v3.8.1/mod.ts";
import { Denops } from "https://deno.land/x/denops_std@v7.0.2/mod.ts";
import { backQuote, brackets, quotes } from "./brackets.ts";

export async function replaceBrackets(
Expand Down
10 changes: 7 additions & 3 deletions denops/kakkonan/mod/surround.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { Denops } from "https://deno.land/x/denops_std@v3.8.1/mod.ts";
import { execute } from "https://deno.land/x/denops_std@v3.8.1/helper/mod.ts";
import { Denops } from "https://deno.land/x/denops_std@v7.0.2/mod.ts";
import { execute } from "https://deno.land/x/denops_std@v7.0.2/helper/mod.ts";
import { brackets } from "./brackets.ts";

export async function surroundBrackets(
vim: Denops,
inputBracket: string,
): Promise<void> {
let a = 1;
await execute(vim, "normal `<");

let startColNo: number;
Expand Down Expand Up @@ -41,12 +42,15 @@ export async function surroundBrackets(

// 複数行を一気に囲もうとするとバグる
// TODO: 原因調査
if (startLineNo != finishLineNo) {
if (startLineNo !== finishLineNo) {
const startLine = await vim.call("getline", startLineNo) as string;
const finishLine = await vim.call("getline", finishLineNo) as string;

const updateStartLine = startLine.slice(0, startColNo - 1) +
inputBracket + startLine.slice(startColNo - 1, startLine.length);
console.log(updateStartLine);
console.log(a);
a++;
const updateFinishLine = finishLine.slice(0, finishColNo) +
brackets[inputBracket] +
finishLine.slice(finishColNo, finishLine.length);
Expand Down

0 comments on commit 351a3ab

Please sign in to comment.