fix(vim.hl): nvim_buf_del_extmark on invalid buffer #33331

Problem:
nvim_buf_del_extmark error if buffer is destroyed before timer stops

Solution:
check nvim_buf_is_valid.
This commit is contained in:
phanium
2025-04-06 06:56:40 +08:00
committed by GitHub
parent f9dec1228d
commit 28e8190185
2 changed files with 4 additions and 0 deletions

View File

@@ -222,6 +222,7 @@ describe('vim.hl.on_yank', function()
it('does not show errors even if buffer is wiped before timeout', function()
command('new')
n.feed('ifoo<esc>') -- set '[, ']
exec_lua(function()
vim.hl.on_yank({
timeout = 10,