comparison src/popupwin.c @ 18239:9e696b8fee7d v8.1.2114

patch 8.1.2114: when a popup is closed with CTRL-C the callback aborts Commit: https://github.com/vim/vim/commit/fd00c042afc40539447e798aadbd0a2219fdbdc1 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Oct 5 11:56:54 2019 +0200 patch 8.1.2114: when a popup is closed with CTRL-C the callback aborts Problem: When a popup is closed with CTRL-C the callback aborts. Solution: Reset got_int when invoking the callback. (closes https://github.com/vim/vim/issues/5008)
author Bram Moolenaar <Bram@vim.org>
date Sat, 05 Oct 2019 12:00:04 +0200
parents e6c83ae0c4d0
children a776385eac9f
comparison
equal deleted inserted replaced
18238:545afb8a9207 18239:9e696b8fee7d
2761 linenr_T old_lnum = wp->w_cursor.lnum; 2761 linenr_T old_lnum = wp->w_cursor.lnum;
2762 2762
2763 // Emergency exit: CTRL-C closes the popup. 2763 // Emergency exit: CTRL-C closes the popup.
2764 if (c == Ctrl_C) 2764 if (c == Ctrl_C)
2765 { 2765 {
2766 int save_got_int = got_int;
2767
2768 // Reset got_int to avoid the callback isn't called.
2769 got_int = FALSE;
2766 popup_close_with_retval(wp, -1); 2770 popup_close_with_retval(wp, -1);
2771 got_int |= save_got_int;
2767 return 1; 2772 return 1;
2768 } 2773 }
2769 2774
2770 argv[0].v_type = VAR_NUMBER; 2775 argv[0].v_type = VAR_NUMBER;
2771 argv[0].vval.v_number = (varnumber_T)wp->w_id; 2776 argv[0].vval.v_number = (varnumber_T)wp->w_id;