comparison src/drawscreen.c @ 27712:9c96612730a0 v8.2.4382

patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter Commit: https://github.com/vim/vim/commit/e4835bf34001471a102528659af009bc46361141 Author: Bram Moolenaar <Bram@vim.org> Date: Mon Feb 14 19:17:53 2022 +0000 patch 8.2.4382: a custom 'tabline' may cause Esc to work like Enter 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)
author Bram Moolenaar <Bram@vim.org>
date Mon, 14 Feb 2022 20:30:02 +0100
parents 1bdb36828dcc
children c1d1639b52dd
comparison
equal deleted inserted replaced
27711:6fdafb9cb90e 27712:9c96612730a0
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;
575 574
576 // When called recursively return. This can happen when the statusline 575 // When called recursively return. This can happen when the statusline
577 // contains an expression that triggers a redraw. 576 // contains an expression that triggers a redraw.
578 if (entered) 577 if (entered)
579 return; 578 return;
590 (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL 589 (char_u *)"", OPT_FREE | (*wp->w_p_stl != NUL
591 ? OPT_LOCAL : OPT_GLOBAL), SID_ERROR); 590 ? OPT_LOCAL : OPT_GLOBAL), SID_ERROR);
592 } 591 }
593 did_emsg |= saved_did_emsg; 592 did_emsg |= saved_did_emsg;
594 entered = FALSE; 593 entered = FALSE;
595
596 // A user function may reset KeyTyped, restore it.
597 KeyTyped = saved_KeyTyped;
598 } 594 }
599 #endif 595 #endif
600 596
601 /* 597 /*
602 * Show current status info in ruler and various other places 598 * Show current status info in ruler and various other places