diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-04-13 23:09:41 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-04-13 23:10:14 +0200 |
commit | 086088ce4499d50c3b2377e217917370bd6387c2 (patch) | |
tree | 74af4a09affca72c091166f2ec13c406882540b5 | |
parent | 66c66d8db8ab5cb6d0c6d85d64556d7cf20b04fa (diff) | |
download | rneovim-086088ce4499d50c3b2377e217917370bd6387c2.tar.gz rneovim-086088ce4499d50c3b2377e217917370bd6387c2.tar.bz2 rneovim-086088ce4499d50c3b2377e217917370bd6387c2.zip |
vim-patch:9.0.1451: unnecessary redrawing when 'showcmdloc' is not "last"
Problem: Unnecessary redrawing when 'showcmdloc' is not "last".
Solution: Redraw later when "showcmd_is_clear" is set. (Luuk van Baal,
closes vim/vim#12260)
https://github.com/vim/vim/commit/aa7f25ebf16b8be99239af1134b441e3da93060a
-rw-r--r-- | src/nvim/normal.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index b11d5a3c32..718c51deb0 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -1173,7 +1173,7 @@ static int normal_execute(VimState *state, int key) msg_col = 0; } - s->old_pos = curwin->w_cursor; // remember where cursor was + s->old_pos = curwin->w_cursor; // remember where the cursor was // When 'keymodel' contains "startsel" some keys start Select/Visual // mode. @@ -1997,13 +1997,21 @@ static void display_showcmd(void) showcmd_is_clear = (len == 0); if (*p_sloc == 's') { - win_redr_status(curwin); - setcursor(); // put cursor back where it belongs + if (showcmd_is_clear) { + curwin->w_redr_status = true; + } else { + win_redr_status(curwin); + setcursor(); // put cursor back where it belongs + } return; } if (*p_sloc == 't') { - draw_tabline(); - setcursor(); // put cursor back where it belongs + if (showcmd_is_clear) { + redraw_tabline = true; + } else { + draw_tabline(); + setcursor(); // put cursor back where it belongs + } return; } // 'showcmdloc' is "last" or empty |