Mercurial > vim
changeset 29469:86eac190ec42 v9.0.0076
patch 9.0.0076: no test for what patch 8.1.1424 fixes
Commit: https://github.com/vim/vim/commit/92a1678d488b7d023ddf2cd493a6ee0d7fcf1928
Author: zeertzjq <zeertzjq@outlook.com>
Date: Tue Jul 26 12:24:41 2022 +0100
patch 9.0.0076: no test for what patch 8.1.1424 fixes
Problem: No test for what patch 8.1.1424 fixes.
Solution: Add a test. (closes https://github.com/vim/vim/issues/10789)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Tue, 26 Jul 2022 13:30:03 +0200 |
parents | 55f974b6776d |
children | 513b1ece5ce2 |
files | src/popupmenu.c src/testdir/test_popup.vim src/version.c |
diffstat | 3 files changed, 23 insertions(+), 2 deletions(-) [+] |
line wrap: on
line diff
--- a/src/popupmenu.c +++ b/src/popupmenu.c @@ -1549,8 +1549,8 @@ pum_show_popupmenu(vimmenu_T *menu) c = vgetc(); - // Bail out when typing Esc, CTRL-C or some callback closed the popup - // menu. + // 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)
--- a/src/testdir/test_popup.vim +++ b/src/testdir/test_popup.vim @@ -984,6 +984,25 @@ func Test_menu_only_exists_in_terminal() 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>