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)

aa7f25ebf1
(cherry picked from commit 086088ce44)
This commit is contained in:
Luuk van Baal
2023-04-13 23:09:41 +02:00
committed by github-actions[bot]
parent d24bdc4999
commit 69d4e64c60

View File

@@ -1173,7 +1173,7 @@ static int normal_execute(VimState *state, int key)
msg_col = 0; 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 // When 'keymodel' contains "startsel" some keys start Select/Visual
// mode. // mode.
@@ -1997,13 +1997,21 @@ static void display_showcmd(void)
showcmd_is_clear = (len == 0); showcmd_is_clear = (len == 0);
if (*p_sloc == 's') { if (*p_sloc == 's') {
win_redr_status(curwin); if (showcmd_is_clear) {
setcursor(); // put cursor back where it belongs curwin->w_redr_status = true;
} else {
win_redr_status(curwin);
setcursor(); // put cursor back where it belongs
}
return; return;
} }
if (*p_sloc == 't') { if (*p_sloc == 't') {
draw_tabline(); if (showcmd_is_clear) {
setcursor(); // put cursor back where it belongs redraw_tabline = true;
} else {
draw_tabline();
setcursor(); // put cursor back where it belongs
}
return; return;
} }
// 'showcmdloc' is "last" or empty // 'showcmdloc' is "last" or empty