mirror of
https://github.com/neovim/neovim.git
synced 2026-10-26 15:40:20 -05:00
fix(lsp): do not clear the codelens on the last line #38226
Problem The logic that clears codelenses beyond the buffer also removes the codelenses on the last line. Solution Do not clear the codelens on the last line.
This commit is contained in:
1 parent
5b5b7eb8d4
commit
0cc4f53b40
2 files changed
+21
-2
No files matched your search
@@ -278,9 +278,10 @@ function Provider:on_win(toprow, botrow)
|
||||
end
|
||||
end
|
||||
|
||||
-- Clear extmarks beyond the bottom of the buffer.
|
||||
if botrow == api.nvim_buf_line_count(self.bufnr) - 1 then
|
||||
for _, state in pairs(self.client_state) do
|
||||
api.nvim_buf_clear_namespace(self.bufnr, state.namespace, botrow, -1)
|
||||
api.nvim_buf_clear_namespace(self.bufnr, state.namespace, botrow + 1, -1)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -392,8 +392,26 @@ describe('vim.lsp.codelens', function()
|
||||
} |
|
||||
} |
|
||||
|
|
||||
{1: ▶︎ Run } |
|
||||
^ |
|
||||
{1:~ }|*6
|
||||
{1:~ }|*5
|
||||
4 fewer lines |
|
||||
]])
|
||||
feed('dd')
|
||||
screen:expect([[
|
||||
{1: 1 implementation} |
|
||||
struct S { |
|
||||
a: i32, |
|
||||
b: String, |
|
||||
} |
|
||||
|
|
||||
impl S { |
|
||||
fn new(a: i32, b: String) -> Self { |
|
||||
S { a, b } |
|
||||
} |
|
||||
} |
|
||||
^ |
|
||||
{1:~ }|*7
|
||||
4 fewer lines |
|
||||
]])
|
||||
end)
|
||||
|
||||
Reference in new issue
Block a user