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 -- [email protected] -- 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    ///

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/vim_dev/202011151310.0AFDA7bD863387%40masaka.moolenaar.net.

Raspunde prin e-mail lui