Skip to content

Commit 1ee3f03

Browse files
committed
fix: 116, check buf is valid in async function
1 parent 7291e45 commit 1ee3f03

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/hlchunk/mods/chunk/init.lua

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,9 @@ function ChunkMod:createAutocmd()
176176
BaseMod.createAutocmd(self)
177177
local render_cb = function(event, opts)
178178
local bufnr = event.buf
179+
if not api.nvim_buf_is_valid(bufnr) then
180+
return
181+
end
179182
local winid = api.nvim_get_current_win()
180183
local pos = api.nvim_win_get_cursor(winid)
181184

0 commit comments

Comments
 (0)