diff options
author | Bram Moolenaar <Bram@vim.org> | 2019-09-01 23:27:05 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2019-09-01 23:27:05 +0200 |
commit | 934470e562df7bc778ff916db44918f3ccecc7cc (patch) | |
tree | 91482f34a077a324fbbaa9402a13eedc389677d0 /src/popupwin.c | |
parent | 55008aad50601cae079037fda8fb434cde70c0f4 (diff) | |
download | vim-git-8.1.1963.tar.gz |
patch 8.1.1963: popup window filter may be called recursivelyv8.1.1963
Problem: Popup window filter may be called recursively when using a Normal
mode command.
Solution: Prevent recursiveness. (closes #4887) Also restore KeyTyped.
Diffstat (limited to 'src/popupwin.c')
-rw-r--r-- | src/popupwin.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/popupwin.c b/src/popupwin.c index 714529181..abf40e8c0 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -2764,8 +2764,14 @@ invoke_popup_filter(win_T *wp, int c) int popup_do_filter(int c) { + static int recursive = FALSE; int res = FALSE; win_T *wp; + int save_KeyTyped = KeyTyped; + + if (recursive) + return FALSE; + recursive = TRUE; popup_reset_handled(); @@ -2776,13 +2782,15 @@ popup_do_filter(int c) wp = mouse_find_win(&row, &col, FIND_POPUP); if (wp != NULL && popup_close_if_on_X(wp, row, col)) - return TRUE; + res = TRUE; } while (!res && (wp = find_next_popup(FALSE)) != NULL) if (wp->w_filter_cb.cb_name != NULL) res = invoke_popup_filter(wp, c); + recursive = FALSE; + KeyTyped = save_KeyTyped; return res; } |