mirror of
https://github.com/neovim/neovim.git
synced 2025-09-07 11:58:17 +00:00
fix(lsp): codelens extmark line out of range (#35070)
Problem: When setting extmark for a codelens after it's asynchronously resolved, the line may have been removed, raising "invalid 'line': out of range" error. This is a regression from #34888. Solution: Re-introduce the line count check.
This commit is contained in:
@@ -260,7 +260,9 @@ local function resolve_lenses(lenses, bufnr, client_id, callback)
|
||||
local function display_line_countdown()
|
||||
num_resolved_line_lenses = num_resolved_line_lenses + 1
|
||||
if num_resolved_line_lenses == #line_lenses then
|
||||
display_line_lenses(bufnr, ns, line, line_lenses)
|
||||
if line <= api.nvim_buf_line_count(bufnr) then
|
||||
display_line_lenses(bufnr, ns, line, line_lenses)
|
||||
end
|
||||
countdown(#line_lenses)
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user