Files
neovim/runtime/lua/vim
penglei 84fd9214cc fix(diagnostic): skip out-of-range lnum in underline handler #40839
Problem:
`vim.diagnostic.handlers.underline.show` throws `E565: Index out of bounds` when
it tries to underline a diagnostic whose `lnum` is past the end of the buffer.
This happens with stale diagnostics set on an unloaded buffer (e.g. via
`bufadd()`) that are drawn only after the buffer is loaded: by then the file on
disk can be shorter than the `lnum` the diagnostic carried. File pickers
(snacks.nvim) that open files via `bufadd` + `:buffer` hit this whenever an LSP
server has already emitted diagnostics for that URI.


Solution:
Skip diagnostics with an out-of-range `lnum` in the underline handler.

Other handlers `M.virtual_text.show()`, `M.signs.show()`, have a similar condition.
2026-07-20 06:59:21 -04:00
..
2026-05-10 11:03:15 -04:00
2026-07-08 07:16:29 -04:00
2026-06-08 16:12:14 -04:00
2026-01-09 10:07:15 +01:00
2026-05-30 12:57:24 +02:00
2026-07-13 19:44:15 +02:00
2026-05-30 12:57:24 +02:00
2026-07-13 19:44:15 +02:00