Skip to content

Commit 369ed28

Browse files
benlubasvhyrro
authored andcommitted
fix(todo-introspector): check that the buffer is valid
1 parent 6cdd6a1 commit 369ed28

File tree

1 file changed

+3
-0
lines changed
  • lua/neorg/modules/core/todo-introspector

1 file changed

+3
-0
lines changed

lua/neorg/modules/core/todo-introspector/module.lua

+3
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,9 @@ function module.public.attach_introspector(buffer)
6262

6363
vim.api.nvim_buf_attach(buffer, false, {
6464
on_lines = vim.schedule_wrap(function(_, buf, _, first)
65+
if not vim.api.nvim_buf_is_valid(buf) then
66+
return
67+
end
6568
-- If we delete the last line of a file `first` will point to a nonexistent line
6669
-- For this reason we fall back to the line count (accounting for 0-based indexing)
6770
-- whenever a change to the document is made.

0 commit comments

Comments
 (0)