aboutsummaryrefslogtreecommitdiff
path: root/test/functional/vimscript/executable_spec.lua
diff options
context:
space:
mode:
authorpenglei <lambit@qq.com>2026-07-20 18:59:21 +0800
committerGitHub <noreply@github.com>2026-07-20 06:59:21 -0400
commit84fd9214cc71860e8bcbcdbdb4bd45bf00cabf50 (patch)
treef32085f84ce274c15e57fd3b20aa7afca1b57ad6 /test/functional/vimscript/executable_spec.lua
parent09a4cc8c50285fa5c7c094650f505de11f90dccc (diff)
downloadrneovim-84fd9214cc71860e8bcbcdbdb4bd45bf00cabf50.tar.gz
rneovim-84fd9214cc71860e8bcbcdbdb4bd45bf00cabf50.tar.bz2
rneovim-84fd9214cc71860e8bcbcdbdb4bd45bf00cabf50.zip
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.
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions