shellRaining/hlchunk.nvim

Error when deleting or renaming files

sho-87 opened this issue · 3 comments

When I use neo-tree (popup) to rename files or to delete them, especially if they are already open in a window, I will get a hlchunk error that looks like:

   Error  4:09:39 PM msg_show.lua_error Error executing vim.schedule lua callback: ...data/lazy/hlchunk.nvim/lua/hlchunk/utils/chunkHelper.lua:22: Invalid buffer id: 132
stack traceback:
	[C]: in function '__index'
	...data/lazy/hlchunk.nvim/lua/hlchunk/utils/chunkHelper.lua:22: in function 'has_treesitter'
	...data/lazy/hlchunk.nvim/lua/hlchunk/utils/chunkHelper.lua:62: in function 'get_chunk_range'
	...m-data/lazy/hlchunk.nvim/lua/hlchunk/mods/chunk/init.lua:178: in function 'fn'
	.../nvim-data/lazy/hlchunk.nvim/lua/hlchunk/utils/timer.lua:64: in function 'fn'
	.../nvim-data/lazy/hlchunk.nvim/lua/hlchunk/utils/timer.lua:16: in function <.../nvim-data/lazy/hlchunk.nvim/lua/hlchunk/utils/timer.lua:15>
   Error  4:09:39 PM msg_show.lua_error Error executing vim.schedule lua callback: ...data/lazy/hlchunk.nvim/lua/hlchunk/utils/chunkHelper.lua:22: Invalid buffer id: 132
stack traceback:
	[C]: in function '__index'
	...data/lazy/hlchunk.nvim/lua/hlchunk/utils/chunkHelper.lua:22: in function 'has_treesitter'
	...data/lazy/hlchunk.nvim/lua/hlchunk/utils/chunkHelper.lua:62: in function 'get_chunk_range'
	...m-data/lazy/hlchunk.nvim/lua/hlchunk/mods/chunk/init.lua:178: in function 'fn'
	.../nvim-data/lazy/hlchunk.nvim/lua/hlchunk/utils/timer.lua:64: in function 'fn'
	.../nvim-data/lazy/hlchunk.nvim/lua/hlchunk/utils/timer.lua:16: in function <.../nvim-data/lazy/hlchunk.nvim/lua/hlchunk/utils/timer.lua:15>

Kapture 2024-06-16 at 23 34 27

can't reproduce, can you provide more infomation?

hmm this is quite hard to reproduce as it feels quite random. the next time I experience it, what information should I grab that might be useful in diagnosing the problem?

add a buf id check before render, now this would not happened (maybe...)