mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
Merge pull request #19514 from zeertzjq/vim-8.1.1424
vim-patch:8.1.1424,9.0.0076: crash when popup menu is deleted while waiting for char
This commit is contained in:
commit
1a4753f25a
@ -1054,7 +1054,10 @@ void pum_show_popupmenu(vimmenu_T *menu)
|
|||||||
ui_flush();
|
ui_flush();
|
||||||
|
|
||||||
int c = vgetc();
|
int c = vgetc();
|
||||||
if (c == ESC || c == Ctrl_C) {
|
|
||||||
|
// 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;
|
break;
|
||||||
} else if (c == CAR || c == NL) {
|
} else if (c == CAR || c == NL) {
|
||||||
// enter: select current item, if any, and close
|
// enter: select current item, if any, and close
|
||||||
|
@ -955,6 +955,25 @@ func Test_menu_only_exists_in_terminal()
|
|||||||
endtry
|
endtry
|
||||||
endfunc
|
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()
|
func Test_popup_complete_info_01()
|
||||||
new
|
new
|
||||||
inoremap <buffer><F5> <C-R>=complete_info().mode<CR>
|
inoremap <buffer><F5> <C-R>=complete_info().mode<CR>
|
||||||
|
Loading…
Reference in New Issue
Block a user