Skip to content

Commit b97bee2

Browse files
committed
fix: Ensure Win{Enter|Leave} events propagate to panels.
1 parent 2c7cc1a commit b97bee2

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

lua/diffview/ui/panel.lua

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,13 @@ function Panel:on_autocmd(event, opts)
416416
local callback = function(_, state)
417417
local win_match, buf_match
418418
if state.event:match("^Win") then
419-
win_match = tonumber(state.match)
419+
if vim.tbl_contains({ "WinLeave", "WinEnter" }, state.event)
420+
and api.nvim_get_current_win() == self.winid
421+
then
422+
buf_match = state.buf
423+
else
424+
win_match = tonumber(state.match)
425+
end
420426
elseif state.event:match("^Buf") then
421427
buf_match = state.buf
422428
end

0 commit comments

Comments
 (0)