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)
diff --git a/src/popupmenu.c b/src/popupmenu.c
index 279a68d..8033d72 100644
--- a/src/popupmenu.c
+++ b/src/popupmenu.c
@@ -795,6 +795,10 @@
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.
@@ -973,6 +977,10 @@
// 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
}
diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim
index fdfa305..e5d4697 100644
--- a/src/testdir/test_popupwin.vim
+++ b/src/testdir/test_popupwin.vim
@@ -3243,6 +3243,10 @@
call popup_show(id)
endif
endfunc
+
+ " Check that no autocommands are triggered for the info popup
+ au WinEnter * if win_gettype() == 'popup' | call setline(2, 'WinEnter') | endif
+ au WinLeave * if win_gettype() == 'popup' | call setline(2, 'WinLeave') | endif
END
return lines
endfunc
diff --git a/src/version.c b/src/version.c
index 502a876..3990076 100644
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 1989,
+/**/
1988,
/**/
1987,