0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

patch 8.2.1989: info popup triggers WinEnter and WinLeave autocommands

Problem:    Info popup triggers WinEnter and WinLeave autocommands.
Solution:   Suppress autocommands for the info popup. (closes #7296)
This commit is contained in:
Bram Moolenaar
2020-11-15 14:09:37 +01:00
parent e41decc892
commit 2dfae04f37
3 changed files with 14 additions and 0 deletions

View File

@@ -795,6 +795,10 @@ pum_set_selected(int n, int repeat UNUSED)
use_popup = USEPOPUP_NORMAL;
else
use_popup = USEPOPUP_NONE;
if (use_popup != USEPOPUP_NONE)
// don't use WinEnter or WinLeave autocommands for the info
// popup
block_autocmds();
# endif
// Open a preview window and set "curwin" to it.
// 3 lines by default, prefer 'previewheight' if set and smaller.
@@ -972,6 +976,10 @@ pum_set_selected(int n, int repeat UNUSED)
if (WIN_IS_POPUP(curwin))
// can't keep focus in a popup window
win_enter(firstwin, TRUE);
# endif
# ifdef FEAT_PROP_POPUP
if (use_popup != USEPOPUP_NONE)
unblock_autocmds();
# endif
}
#endif