diff options
author | Bram Moolenaar <Bram@vim.org> | 2020-08-10 21:19:23 +0200 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2020-08-10 21:19:23 +0200 |
commit | 6f8f7337c1211692d508239eb4cbc8a6f67de497 (patch) | |
tree | 339684171882f6d1f4895aaadc467aa9d460fae4 /src | |
parent | bf61fdd00808bfa7cc61a82c719fc220bba50ba3 (diff) |
patch 8.2.1415: closing a popup window with CTRL-C interrupts 'statusline'v8.2.1415
Problem: Closing a popup window with CTRL-C interrupts 'statusline' if it
calls a function.
Solution: Reset got_int while redrawing. (closes #6675)
Diffstat (limited to 'src')
-rw-r--r-- | src/popupwin.c | 7 | ||||
-rw-r--r-- | src/testdir/dumps/Test_popupwin_ctrl_c.dump | 10 | ||||
-rw-r--r-- | src/testdir/test_popupwin.vim | 25 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 44 insertions, 0 deletions
diff --git a/src/popupwin.c b/src/popupwin.c index cc0843bfc2..ff9e810044 100644 --- a/src/popupwin.c +++ b/src/popupwin.c @@ -3209,7 +3209,14 @@ popup_do_filter(int c) res = invoke_popup_filter(wp, c); if (must_redraw > was_must_redraw) + { + int save_got_int = got_int; + + // Reset got_int to avoid a function used in the statusline aborts. + got_int = FALSE; redraw_after_callback(FALSE); + got_int |= save_got_int; + } recursive = FALSE; KeyTyped = save_KeyTyped; return res; diff --git a/src/testdir/dumps/Test_popupwin_ctrl_c.dump b/src/testdir/dumps/Test_popupwin_ctrl_c.dump new file mode 100644 index 0000000000..d6636aef40 --- /dev/null +++ b/src/testdir/dumps/Test_popupwin_ctrl_c.dump @@ -0,0 +1,10 @@ +> +0&#ffffff0@36||+1&&| +0&&@36 +|~+0#4040ff13&| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|~| @35||+1#0000000&|~+0#4040ff13&| @35 +|[+3#0000000&|N|o| |N|a|m|e|]| @9|0|,|0|-|1| @9|A|l@1| |[+1&&|N|o| |N|a|m|e|]| @9|0|,|0|-|1| @9|A|l@1 +| +0&&@74 diff --git a/src/testdir/test_popupwin.vim b/src/testdir/test_popupwin.vim index f13a7e057c..6ec4ef2529 100644 --- a/src/testdir/test_popupwin.vim +++ b/src/testdir/test_popupwin.vim @@ -3479,6 +3479,31 @@ func Test_popupwin_filter_input_multibyte() unlet g:bytes endfunc +func Test_popupwin_filter_close_ctrl_c() + CheckScreendump + + let lines =<< trim END + vsplit + set laststatus=2 + set statusline=%!Statusline() + + function Statusline() abort + return '%<%f %h%m%r%=%-14.(%l,%c%V%) %P' + endfunction + + call popup_create('test test test test...', {'filter': {-> 0}}) + END + call writefile(lines, 'XtestPopupCtrlC') + + let buf = RunVimInTerminal('-S XtestPopupCtrlC', #{rows: 10}) + + call term_sendkeys(buf, "\<C-C>") + call VerifyScreenDump(buf, 'Test_popupwin_ctrl_c', {}) + + call StopVimInTerminal(buf) + call delete('XtestPopupCorners') +endfunc + func Test_popupwin_atcursor_far_right() new diff --git a/src/version.c b/src/version.c index 38dc86fa47..e7a1039714 100644 --- a/src/version.c +++ b/src/version.c @@ -755,6 +755,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 1415, +/**/ 1414, /**/ 1413, |