vim-patch:8.1.1424: crash when popup menu is deleted while waiting for char

Problem:    Crash when popup menu is deleted while waiting for char.
Solution:   Bail out when pum_array was cleared.
5c3fb04623
This commit is contained in:
zeertzjq 2022-07-26 07:46:19 +08:00
parent cbfae548e8
commit ee8606d31f

View File

@ -1054,7 +1054,10 @@ void pum_show_popupmenu(vimmenu_T *menu)
ui_flush();
int c = vgetc();
if (c == ESC || c == Ctrl_C) {
// 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) {
// enter: select current item, if any, and close