Skip to content

Commit 1006e63

Browse files
committed
fix: add buffer check in autocommand
Signed-off-by: Guennadi Maximov C <g.maxc.fox@protonmail.com>
1 parent a35923e commit 1006e63

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

lua/hoversplit/init.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -98,11 +98,12 @@ function M.setup(options)
9898

9999
vim.api.nvim_create_autocmd({ "CursorMoved", "CursorMovedI" }, {
100100
group = vim.api.nvim_create_augroup("HoverSplit", { clear = true }),
101-
callback = function()
102-
M.update_hover_content()
101+
callback = function(args)
102+
if args.buf ~= M.hover_bufnr then
103+
M.update_hover_content()
104+
end
103105
end,
104106
})
105-
-- vim.cmd([[ autocmd CursorMoved,CursorMovedI * lua require("hoversplit").update_hover_content() ]])
106107

107108
if config.options.key_bindings_disabled then
108109
return

0 commit comments

Comments
 (0)