]> granicus.if.org Git - vim/commitdiff
patch 8.1.2114: when a popup is closed with CTRL-C the callback aborts v8.1.2114
authorBram Moolenaar <Bram@vim.org>
Sat, 5 Oct 2019 09:56:54 +0000 (11:56 +0200)
committerBram Moolenaar <Bram@vim.org>
Sat, 5 Oct 2019 09:56:54 +0000 (11:56 +0200)
Problem:    When a popup is closed with CTRL-C the callback aborts.
Solution:   Reset got_int when invoking the callback. (closes #5008)

src/popupwin.c
src/version.c

index 06812073e60b269c50a9ab10945f120ddd30df44..6b0b383b089fa41768aa7fe9b3424879762134c3 100644 (file)
@@ -2763,7 +2763,12 @@ invoke_popup_filter(win_T *wp, int c)
     // Emergency exit: CTRL-C closes the popup.
     if (c == Ctrl_C)
     {
+       int save_got_int = got_int;
+
+       // Reset got_int to avoid the callback isn't called.
+       got_int = FALSE;
        popup_close_with_retval(wp, -1);
+       got_int |= save_got_int;
        return 1;
     }
 
index d37ee657d01712914795450cc59891001ca462ab..0673d7e7873137791d45a6d246f34fe2c9daffb5 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2114,
 /**/
     2113,
 /**/