We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Win{Enter|Leave}
1 parent 2c7cc1a commit b97bee2Copy full SHA for b97bee2
lua/diffview/ui/panel.lua
@@ -416,7 +416,13 @@ function Panel:on_autocmd(event, opts)
416
local callback = function(_, state)
417
local win_match, buf_match
418
if state.event:match("^Win") then
419
- win_match = tonumber(state.match)
+ 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
426
elseif state.event:match("^Buf") then
427
buf_match = state.buf
428
end
0 commit comments