diff --git a/src/__tests__/handler/semanticTokens.test.ts b/src/__tests__/handler/semanticTokens.test.ts index 0eb5578c3d1..6b4486ad677 100644 --- a/src/__tests__/handler/semanticTokens.test.ts +++ b/src/__tests__/handler/semanticTokens.test.ts @@ -317,13 +317,13 @@ describe('semanticTokens', () => { await item.onCursorMoved() await helper.waitValue(async () => { let markers = await buf.getExtMarks(ns, 0, -1, { details: true }) - return markers.length > 300 + return markers.length > 100 }, true) nvim.command('normal! 200G', true) await item.onCursorMoved() await helper.waitValue(async () => { let markers = await buf.getExtMarks(ns, 0, -1, { details: true }) - return markers.length > 500 + return markers.length > 200 }, true) }) diff --git a/src/handler/semanticTokens/buffer.ts b/src/handler/semanticTokens/buffer.ts index 5d497579eae..0330e0332bf 100644 --- a/src/handler/semanticTokens/buffer.ts +++ b/src/handler/semanticTokens/buffer.ts @@ -389,8 +389,8 @@ export default class SemanticTokensBuffer implements SyncItem { let height = workspace.env.lines spans.forEach(o => { let s = o[0] - o[0] = Math.max(0, Math.floor(s - height * 1.5)) - o[1] = Math.min(lineCount, Math.ceil(o[1] + height * 1.5), s + height * 2) + o[0] = Math.max(0, Math.floor(s - height / 2)) + o[1] = Math.min(lineCount, Math.ceil(o[1] + height / 2), s + height / 2) }) for (let [start, end] of Regions.mergeSpans(spans)) { if (!skipCheck && regions.has(start, end)) continue