diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-01-14 19:32:12 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2023-01-14 20:09:56 +0800 |
commit | f95ad61a8945b64a58750073e2cb2beb30767062 (patch) | |
tree | a0672cadbf5e9d51401606e59adf9da8c4c953d7 | |
parent | 81473c8ab241286aafe8724d173df2c6b692e119 (diff) | |
download | rneovim-f95ad61a8945b64a58750073e2cb2beb30767062.tar.gz rneovim-f95ad61a8945b64a58750073e2cb2beb30767062.tar.bz2 rneovim-f95ad61a8945b64a58750073e2cb2beb30767062.zip |
vim-patch:8.2.4391: command line executed when typing Esc in the GUI
Problem: Command line executed when typing Esc in the GUI.
Solution: Move saving/restoring KeyTyped to build_stl_str_hl().
(closes vim/vim#9783)
https://github.com/vim/vim/commit/0e1f36fc59b589e4755fd9102013971f45222084
Co-authored-by: Bram Moolenaar <Bram@vim.org>
-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 ca157ba697..db3e3f91bf 100644 --- a/src/nvim/statusline.c +++ b/src/nvim/statusline.c @@ -268,7 +268,6 @@ 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; @@ -423,9 +422,6 @@ 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) @@ -948,6 +944,7 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n char *usefmt = fmt; const int save_must_redraw = must_redraw; const int save_redr_type = curwin->w_redr_type; + const bool save_KeyTyped = KeyTyped; // TODO(Bram): find out why using called_emsg_before makes tests fail, does it // matter? // const int called_emsg_before = called_emsg; @@ -2153,5 +2150,8 @@ int build_stl_str_hl(win_T *wp, char *out, size_t outlen, char *fmt, char *opt_n set_string_option_direct(opt_name, -1, "", OPT_FREE | opt_scope, SID_ERROR); } + // A user function may reset KeyTyped, restore it. + KeyTyped = save_KeyTyped; + return width; } |