Skip to content

Commit

Permalink
fix ignore BufEnter and BufLeave events when create popup window
Browse files Browse the repository at this point in the history
After popup window has been created, git-messenager uses
`noautocmd wincmd p` to jump back to the current buffer, which
ignores BufEnter and BufLeave events. Some other plugins depends
on event BufEnter/BufLeave to take effect normally. So git-messenager
should use `wincmd p` to preserve events.

See issue rhysd#65 for details.
  • Loading branch information
Alex-duzhichao committed Mar 23, 2022
1 parent 2e67899 commit ce30af0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion autoload/gitmessenger/popup.vim
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function! s:popup__open() dict abort
execute 'autocmd BufWipeout,BufLeave <buffer> call getbufvar(' . popup_bufnr . ', "__gitmessenger_popup").close()'

if has_key(self.opts, 'enter') && !self.opts.enter
noautocmd wincmd p
wincmd p
if self.type !=# 'floating'
" Opening a preview window may move global position of the cursor.
" `opened_at` is used for checking if the popup window should be
Expand Down

0 comments on commit ce30af0

Please sign in to comment.