mirror of
https://github.com/neovim/neovim
synced 2025-07-16 01:01:49 +00:00
fix(diagnostic): open_float on multi-line diagnostics #28301
Problem: when diagnostic have a range of line, open_float not work. Solution: filter diagnostic by line number range.
This commit is contained in:
@ -1697,7 +1697,7 @@ function M.open_float(opts, ...)
|
||||
if scope == 'line' then
|
||||
--- @param d vim.Diagnostic
|
||||
diagnostics = vim.tbl_filter(function(d)
|
||||
return d.lnum == lnum
|
||||
return lnum >= d.lnum and lnum <= d.end_lnum
|
||||
end, diagnostics)
|
||||
elseif scope == 'cursor' then
|
||||
-- LSP servers can send diagnostics with `end_col` past the length of the line
|
||||
|
Reference in New Issue
Block a user