To: vim_dev@googlegroups.com Subject: Patch 8.2.1415 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.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) Files: src/popupwin.c, src/testdir/test_popupwin.vim, src/testdir/dumps/Test_popupwin_ctrl_c.dump *** ../vim-8.2.1414/src/popupwin.c 2020-08-10 20:39:00.511569559 +0200 --- src/popupwin.c 2020-08-10 21:17:44.647968698 +0200 *************** *** 3209,3215 **** --- 3209,3222 ---- 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; *** ../vim-8.2.1414/src/testdir/test_popupwin.vim 2020-08-10 20:39:00.511569559 +0200 --- src/testdir/test_popupwin.vim 2020-08-10 21:15:30.308512424 +0200 *************** *** 3479,3484 **** --- 3479,3509 ---- 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, "\") + call VerifyScreenDump(buf, 'Test_popupwin_ctrl_c', {}) + + call StopVimInTerminal(buf) + call delete('XtestPopupCorners') + endfunc + func Test_popupwin_atcursor_far_right() new *** ../vim-8.2.1414/src/testdir/dumps/Test_popupwin_ctrl_c.dump 2020-08-10 21:18:42.267732465 +0200 --- src/testdir/dumps/Test_popupwin_ctrl_c.dump 2020-08-10 21:16:00.060392945 +0200 *************** *** 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 *** ../vim-8.2.1414/src/version.c 2020-08-10 20:39:00.511569559 +0200 --- src/version.c 2020-08-10 21:18:51.187695760 +0200 *************** *** 756,757 **** --- 756,759 ---- { /* Add new patch number below this line */ + /**/ + 1415, /**/ -- Did you ever see a "Hit any key to continue" message in a music piece? /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///