To: vim_dev@googlegroups.com Subject: Patch 8.2.1989 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.1989 Problem: Info popup triggers WinEnter and WinLeave autocommands. Solution: Suppress autocommands for the info popup. (closes #7296) Files: src/popupmenu.c, src/testdir/test_popupwin.vim *** ../vim-8.2.1988/src/popupmenu.c 2020-07-18 21:40:22.800647319 +0200 --- src/popupmenu.c 2020-11-15 13:10:21.748045137 +0100 *************** *** 795,800 **** --- 795,804 ---- 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,978 **** --- 977,986 ---- // 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 } *** ../vim-8.2.1988/src/testdir/test_popupwin.vim 2020-11-07 16:58:55.894354883 +0100 --- src/testdir/test_popupwin.vim 2020-11-15 13:05:52.256779048 +0100 *************** *** 3243,3248 **** --- 3243,3252 ---- 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 *** ../vim-8.2.1988/src/version.c 2020-11-14 21:34:12.253496530 +0100 --- src/version.c 2020-11-15 13:13:22.723530503 +0100 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 1989, /**/ -- hundred-and-one symptoms of being an internet addict: 247. You use www.switchboard.com instead of dialing 411 and 555-12-12 for directory assistance. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///