diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-07-26 07:46:19 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-07-26 19:36:24 +0800 |
commit | ee8606d31f01eed4a3e8efb6d8279fb5b4d2845e (patch) | |
tree | e2a2d10d2fd210d4a66569dcb5cdd6f66aabba98 | |
parent | cbfae548e8944801e766f42d966b38491afa8587 (diff) | |
download | rneovim-ee8606d31f01eed4a3e8efb6d8279fb5b4d2845e.tar.gz rneovim-ee8606d31f01eed4a3e8efb6d8279fb5b4d2845e.tar.bz2 rneovim-ee8606d31f01eed4a3e8efb6d8279fb5b4d2845e.zip |
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.
https://github.com/vim/vim/commit/5c3fb04623d0260762f1c3c1ba250a407098ff2a
-rw-r--r-- | src/nvim/popupmnu.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/nvim/popupmnu.c b/src/nvim/popupmnu.c index 5b1b80935e..fce67437c7 100644 --- a/src/nvim/popupmnu.c +++ b/src/nvim/popupmnu.c @@ -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 |