Skip to content

Commit 09d513e

Browse files
committed
fix: missing autocommand group for deletion
1 parent d9044b9 commit 09d513e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lua/float-preview.lua

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,8 +333,11 @@ function FloatPreview:attach(bufnr)
333333
table.insert(
334334
au,
335335
vim.api.nvim_create_autocmd("BufDelete", {
336+
group = preview_au,
336337
callback = function()
337-
vim.api.nvim_del_user_command "TogglePreviewFile"
338+
if vim.fn.exists ":TogglePreviewFile" > 0 then
339+
vim.api.nvim_del_user_command "TogglePreviewFile"
340+
end
338341
end,
339342
})
340343
)

0 commit comments

Comments
 (0)