To: vim_dev@googlegroups.com Subject: Patch 8.2.4382 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4382 (after 8.2.4346) Problem: A custom 'tabline' may cause Esc to work like Enter on the command line when the popup menu is displayed. Solution: Save and restore KeyTyped. (closes #9776) Files: src/drawscreen.c, src/screen.c, src/testdir/test_cmdline.vim, src/testdir/dumps/Test_wildmenu_pum_40.dump *** ../vim-8.2.4381/src/drawscreen.c 2022-02-11 18:51:27.813814058 +0000 --- src/drawscreen.c 2022-02-14 19:13:57.996411723 +0000 *************** *** 571,577 **** { static int entered = FALSE; int saved_did_emsg = did_emsg; - int saved_KeyTyped = KeyTyped; // When called recursively return. This can happen when the statusline // contains an expression that triggers a redraw. --- 571,576 ---- *************** *** 592,600 **** } did_emsg |= saved_did_emsg; entered = FALSE; - - // A user function may reset KeyTyped, restore it. - KeyTyped = saved_KeyTyped; } #endif --- 591,596 ---- *** ../vim-8.2.4381/src/screen.c 2022-01-31 14:59:33.526943578 +0000 --- src/screen.c 2022-02-14 19:16:18.532229532 +0000 *************** *** 1235,1240 **** --- 1235,1241 ---- int use_sandbox = FALSE; win_T *ewp; int p_crb_save; + int save_KeyTyped = KeyTyped; // There is a tiny chance that this gets called recursively: When // redrawing a status line triggers redrawing the ruler or tabline. *************** *** 1394,1399 **** --- 1395,1403 ---- theend: entered = FALSE; + + // A user function may reset KeyTyped, restore it. + KeyTyped = save_KeyTyped; } #endif // FEAT_STL_OPT *** ../vim-8.2.4381/src/testdir/test_cmdline.vim 2022-02-14 11:10:54.365486323 +0000 --- src/testdir/test_cmdline.vim 2022-02-14 19:11:11.560630073 +0000 *************** *** 2107,2112 **** --- 2107,2121 ---- set statusline=%!MyStatusLine() set laststatus=2 endfunc + + func MyTabLine() + return 'my tab line' + endfunc + func SetupTabline() + set statusline= + set tabline=%!MyTabLine() + set showtabline=2 + endfunc [CODE] call writefile(commands, 'Xtest') *************** *** 2298,2303 **** --- 2307,2318 ---- call term_sendkeys(buf, "\") call VerifyScreenDump(buf, 'Test_wildmenu_pum_39', {}) + " Esc still works to abort the command when 'tabline' is set + call term_sendkeys(buf, ":call SetupTabline()\") + call term_sendkeys(buf, ":si\") + call term_sendkeys(buf, "\") + call VerifyScreenDump(buf, 'Test_wildmenu_pum_40', {}) + call term_sendkeys(buf, "\\") call StopVimInTerminal(buf) call delete('Xtest') *** ../vim-8.2.4381/src/testdir/dumps/Test_wildmenu_pum_40.dump 2022-02-14 19:16:37.516205051 +0000 --- src/testdir/dumps/Test_wildmenu_pum_40.dump 2022-02-14 19:15:08.124320584 +0000 *************** *** 0 **** --- 1,10 ---- + |m+1&#ffffff0|y| |t|a|b| |l|i|n|e| @63 + > +0&&@74 + |~+0#4040ff13&| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |~| @73 + |b+3#0000000&|a|r| @71 + | +0&&@74 *** ../vim-8.2.4381/src/version.c 2022-02-14 15:59:01.751062242 +0000 --- src/version.c 2022-02-14 19:13:39.352436018 +0000 *************** *** 752,753 **** --- 752,755 ---- { /* Add new patch number below this line */ + /**/ + 4382, /**/ -- Never overestimate a man's ability to underestimate a woman. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///