aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/nvim/popupmnu.c5
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