comparison src/drawscreen.c @ 27641:1bdb36828dcc v8.2.4346

patch 8.2.4346: a custom statusline may cause Esc to work like Enter Commit: https://github.com/vim/vim/commit/481acb11413a436653e235d2098990b2ad47d195 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Feb 11 18:51:45 2022 +0000 patch 8.2.4346: a custom statusline may cause Esc to work like Enter Problem: A custom statusline may cause Esc to work like Enter on the command line when the popup menu is displayed. Solution: Save and restore KeyTyped. (closes #9749)
author Bram Moolenaar <Bram@vim.org>
date Fri, 11 Feb 2022 20:00:03 +0100
parents 4eb2bf8b2f27
children 9c96612730a0
comparison
equal deleted inserted replaced
27640:72da8327a05e 27641:1bdb36828dcc
569 static void 569 static void
570 redraw_custom_statusline(win_T *wp) 570 redraw_custom_statusline(win_T *wp)
571 { 571 {
572 static int entered = FALSE; 572 static int entered = FALSE;
573 int saved_did_emsg = did_emsg; 573 int saved_did_emsg = did_emsg;
574 int saved_KeyTyped = KeyTyped;
574 575
575 // When called recursively return. This can happen when the statusline 576 // When called recursively return. This can happen when the statusline
576 // contains an expression that triggers a redraw. 577 // contains an expression that triggers a redraw.
577 if (entered) 578 if (entered)
578 return; 579 return;
589 (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL 590 (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL
590 ? OPT_LOCAL : OPT_GLOBAL), SID_ERROR); 591 ? OPT_LOCAL : OPT_GLOBAL), SID_ERROR);
591 } 592 }
592 did_emsg |= saved_did_emsg; 593 did_emsg |= saved_did_emsg;
593 entered = FALSE; 594 entered = FALSE;
595
596 // A user function may reset KeyTyped, restore it.
597 KeyTyped = saved_KeyTyped;
594 } 598 }
595 #endif 599 #endif
596 600
597 /* 601 /*
598 * Show current status info in ruler and various other places 602 * Show current status info in ruler and various other places