Skip to content

Commit

Permalink
fix(semanticTokens): correct end range (#5206)
Browse files Browse the repository at this point in the history
Related #5205
  • Loading branch information
fannheyward authored Nov 26, 2024
1 parent 00da052 commit 2fc3f0d
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/handler/semanticTokens/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -388,9 +388,8 @@ export default class SemanticTokensBuffer implements SyncItem {
if (token.isCancellationRequested || spans.length === 0) return
let height = workspace.env.lines
spans.forEach(o => {
let s = o[0]
o[0] = Math.max(0, Math.floor(s - height / 2))
o[1] = Math.min(lineCount, Math.ceil(o[1] + height / 2), s + height / 2)
o[0] = Math.max(0, Math.floor(o[0] - height / 2))
o[1] = Math.min(lineCount, Math.ceil(o[1] + height / 2))
})
for (let [start, end] of Regions.mergeSpans(spans)) {
if (!skipCheck && regions.has(start, end)) continue
Expand Down

0 comments on commit 2fc3f0d

Please sign in to comment.