diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-14 19:31:11 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-01-14 20:09:56 +0800 |
commit | 81473c8ab241286aafe8724d173df2c6b692e119 (patch) | |
tree | c9e230a4a641d473903a8f66c3a01391efdd2a46 /src/nvim/statusline.c | |
parent | ef77598bfba1cd588f6b310d1806b725b8bec9cb (diff) | |
download | rneovim-81473c8ab241286aafe8724d173df2c6b692e119.tar.gz rneovim-81473c8ab241286aafe8724d173df2c6b692e119.tar.bz2 rneovim-81473c8ab241286aafe8724d173df2c6b692e119.zip |
vim-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 vim/vim#9776)
https://github.com/vim/vim/commit/e4835bf34001471a102528659af009bc46361141
Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/statusline.c')
-rw-r--r-- | src/nvim/statusline.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/statusline.c b/src/nvim/statusline.c index 4f1453a815..ca157ba697 100644 --- a/src/nvim/statusline.c +++ b/src/nvim/statusline.c @@ -268,6 +268,7 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler) StlClickRecord *tabtab; win_T *ewp; int p_crb_save; + bool save_KeyTyped = KeyTyped; bool is_stl_global = global_stl_height() > 0; ScreenGrid *grid = &default_grid; @@ -422,6 +423,9 @@ static void win_redr_custom(win_T *wp, bool draw_winbar, bool draw_ruler) theend: entered = false; + + // A user function may reset KeyTyped, restore it. + KeyTyped = save_KeyTyped; } void win_redr_winbar(win_T *wp) @@ -639,7 +643,6 @@ int fillchar_status(int *attr, win_T *wp) void redraw_custom_statusline(win_T *wp) { static bool entered = false; - bool saved_KeyTyped = KeyTyped; // When called recursively return. This can happen when the statusline // contains an expression that triggers a redraw. @@ -650,9 +653,6 @@ void redraw_custom_statusline(win_T *wp) win_redr_custom(wp, false, false); entered = false; - - // A user function may reset KeyTyped, restore it. - KeyTyped = saved_KeyTyped; } static void ui_ext_tabline_update(void) |