Patch 9.0.0076
Problem:    No test for what patch 8.1.1424 fixes.
Solution:   Add a test. (closes #10789)
Files:      src/popupmenu.c, src/testdir/test_popup.vim


*** ../vim-9.0.0075/src/popupmenu.c     2022-05-07 18:10:54.000000000 +0100
--- src/popupmenu.c     2022-07-26 12:22:57.150995547 +0100
***************
*** 1549,1556 ****
  
        c = vgetc();
  
!       // Bail out when typing Esc, CTRL-C or some callback closed the popup
!       // menu.
        if (c == ESC || c == Ctrl_C || pum_array == NULL)
            break;
        else if (c == CAR || c == NL)
--- 1549,1556 ----
  
        c = vgetc();
  
!       // Bail out when typing Esc, CTRL-C or some callback or <expr> mapping
!       // closed the popup menu.
        if (c == ESC || c == Ctrl_C || pum_array == NULL)
            break;
        else if (c == CAR || c == NL)
*** ../vim-9.0.0075/src/testdir/test_popup.vim  2022-06-21 16:41:32.000000000 
+0100
--- src/testdir/test_popup.vim  2022-07-26 12:22:57.150995547 +0100
***************
*** 984,989 ****
--- 984,1008 ----
    endtry
  endfunc
  
+ " This used to crash before patch 8.1.1424
+ func Test_popup_delete_when_shown()
+   CheckFeature menu
+   CheckNotGui
+ 
+   func Func()
+     popup Foo
+     return "\<Ignore>"
+   endfunc
+ 
+   nmenu Foo.Bar :
+   nnoremap <expr> <F2> Func()
+   call feedkeys("\<F2>\<F2>\<Esc>", 'xt')
+ 
+   delfunc Func
+   nunmenu Foo.Bar
+   nunmap <F2>
+ endfunc
+ 
  func Test_popup_complete_info_01()
    new
    inoremap <buffer><F5> <C-R>=complete_info().mode<CR>
*** ../vim-9.0.0075/src/version.c       2022-07-26 11:42:31.487977143 +0100
--- src/version.c       2022-07-26 12:23:47.270901077 +0100
***************
*** 737,738 ****
--- 737,740 ----
  {   /* Add new patch number below this line */
+ /**/
+     76,
  /**/

-- 
Why is it called "Windows"?  "Gates" would be more appropriate...

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///                                                                      \\\
\\\        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
 \\\            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/20220726112514.69F281C07D4%40moolenaar.net.

Raspunde prin e-mail lui