Skip to content

Commit

Permalink
fix(buffer): check if the buffer that triggered autocmd is in the har…
Browse files Browse the repository at this point in the history
…poon window
  • Loading branch information
NStefan002 committed Jan 17, 2024
1 parent acf1a58 commit c65a723
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions lua/harpoon/buffer.lua
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,12 @@ function M.setup_autocmds_and_keymaps(bufnr)
callback = function(ev)
vim.schedule(function()
local ui = require("harpoon").ui
if
not ui.closing
and ev.buf ~= ui.bufnr
and ui.win_id == vim.api.nvim_get_current_win()
then
local current_win = vim.api.nvim_get_current_win()
local current_win_buf = vim.api.nvim_win_get_buf(current_win)
if ui.win_id ~= current_win or ev.buf ~= current_win_buf then
return
end
if not ui.closing and ev.buf ~= ui.bufnr then
require("harpoon").logger:log("toggle by FileType")
ui:toggle_quick_menu()
end
Expand Down

0 comments on commit c65a723

Please sign in to comment.