diff options
| author | Justin M. Keyes <justinkz@gmail.com> | 2026-06-14 20:20:45 +0200 |
|---|---|---|
| committer | Justin M. Keyes <justinkz@gmail.com> | 2026-06-14 22:00:38 +0200 |
| commit | d34cfe1cb83ad839001a9c5dc8ef588686ca2ff9 (patch) | |
| tree | 98a7eb7b94e349ebb7ec358043066c533ee8c319 /test/functional/vimscript/executable_spec.lua | |
| parent | 2abb9785d3ca6ea73c7f10898638a43dcb507dba (diff) | |
| download | rneovim-d34cfe1cb83ad839001a9c5dc8ef588686ca2ff9.tar.gz rneovim-d34cfe1cb83ad839001a9c5dc8ef588686ca2ff9.tar.bz2 rneovim-d34cfe1cb83ad839001a9c5dc8ef588686ca2ff9.zip | |
fix(autoread): handle autocmd errors
Problem:
Any random ftplugin or other autocmd, can throw an error when
`:checktime` reloads a buffer. This causes a trace which makes it look
like an issue with `autoread.lua`.
vim.schedule callback: …/runtime/lua/nvim/autoread.lua:146:
FileType Autocommands for "*"..function <SNR>1_LoadFTPlugin[20] ..script
…/runtime/ftplugin/help.lua: Vim(runtime):E5113: Lua chunk:
…/runtime/lua/vim/treesitter.lua:216: Index out of bounds
stack traceback:
[C]: in function 'nvim_buf_get_text'
…/runtime/lua/vim/treesitter.lua:216: in function 'get_node_text'
…/runtime/lua/vim/treesitter/query.lua:558: in function 'handler'
…/runtime/lua/vim/treesitter/query.lua:843: in function '_match_predicates'
…/runtime/lua/vim/treesitter/query.lua:1082: in function '(for generator)'
…/runtime/ftplugin/help.lua:91: in function 'runnables'
…/runtime/ftplugin/help.lua:124: in main chunk
[C]: in function 'checktime'
…/runtime/lua/nvim/autoread.lua:146: in function <…/runtime/lua/nvim/autoread.lua:138>
Solution:
Use pcall() and surface the error via nvim_echo.
Diffstat (limited to 'test/functional/vimscript/executable_spec.lua')
0 files changed, 0 insertions, 0 deletions