fix: check for loaded buffers before deleting
This commit is contained in:
parent
c59831a5d1
commit
5b428c014a
@ -82,8 +82,9 @@ function M.create(node)
|
||||
end
|
||||
|
||||
local function clear_buffer(absolute_path)
|
||||
dump(api.nvim_list_bufs())
|
||||
for _, buf in pairs(api.nvim_list_bufs()) do
|
||||
if api.nvim_buf_get_name(buf) == absolute_path then
|
||||
if vim.fn.bufloaded(buf) == 1 and api.nvim_buf_get_name(buf) == absolute_path then
|
||||
api.nvim_command(':bd! '..buf)
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
Reference in New Issue
Block a user