Skip to content

Commit

Permalink
fix(codeLens): clear whole buffer on resolving
Browse files Browse the repository at this point in the history
coc will resolve codeLens onChange/onMove etc, with codeLens in current visible range, then display in virtualText.

If the codeLens.position = top, and outside the current visible, coc won't clear them, and add another line in virtualText.

Clear all on resolving before setting again.
  • Loading branch information
fannheyward committed Nov 20, 2023
1 parent 9c3723a commit 7c24f8c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/handler/codelens/buffer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export default class CodeLensBuffer implements SyncItem {
// nvim could have extmarks exceeded last line.
if (end == total) end = -1
this.nvim.pauseNotification()
this.clear(start - 1, end)
this.clear()
this.setVirtualText(codeLenses)
this.nvim.resumeNotification(true, true)
}
Expand Down

0 comments on commit 7c24f8c

Please sign in to comment.