mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
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.
(cherry picked from commit 28e8190185)
This commit is contained in:
committed by
github-actions[bot]
parent
91481ae7d5
commit
29011e4d45
@@ -128,6 +128,9 @@ function M.range(bufnr, ns, higroup, start, finish, opts)
|
||||
end
|
||||
|
||||
local range_hl_clear = function()
|
||||
if not api.nvim_buf_is_valid(bufnr) then
|
||||
return
|
||||
end
|
||||
for _, mark in ipairs(extmarks) do
|
||||
api.nvim_buf_del_extmark(bufnr, ns, mark)
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user