Skip to content

Commit

Permalink
don't use prop_find
Browse files Browse the repository at this point in the history
  • Loading branch information
uga-rosa committed Dec 29, 2023
1 parent 4d3ef8d commit 0a1b14d
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions denops/denippet/extmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,20 +101,20 @@ export async function getExtmarks(
end: boolean;
}[];

if (props.length === 0) {
return [];
}

const extmarks: Extmark[] = [];
for (let prop of props) {
if (!prop.start) {
continue;
}
const start = { line: prop.lnum - 1, character: prop.col - 1 };
while (!prop.end) {
prop = await vim.prop_find(denops, {
type: propType,
lnum: prop.lnum + 1,
}) as typeof props[number];
for (let i = 0; i < props.length; i++) {
if (props[i].start) {
const start = { line: props[i].lnum - 1, character: props[i].col - 1 };
while (!props[i].end) {
i++;
}
const end = { line: props[i].lnum - 1, character: props[i].col - 1 };
extmarks.push({ extmarkId: props[i].id, range: { start, end } });
}
const range = { start, end: { line: prop.lnum - 1, character: prop.col + prop.length - 1 } };
extmarks.push({ extmarkId: prop.id, range });
}
return extmarks;
}
Expand Down

0 comments on commit 0a1b14d

Please sign in to comment.