perf: only redraw concealed line if cursor has moved horizontally

Building upon #17889, this moves conceal redrawing logic into move.c, so
that concealed line is only redrawn if cursor has moved horizontally.
This commit is contained in:
zeertzjq
2022-03-28 06:45:15 +08:00
parent 9ce2c73180
commit 595c1a724a
4 changed files with 62 additions and 19 deletions

View File

@@ -1288,13 +1288,6 @@ static void normal_redraw(NormalState *s)
update_topline(curwin);
validate_cursor();
// If the cursor moves horizontally when 'concealcursor' is active, then the
// current line needs to be redrawn in order to calculate the correct
// cursor position.
if (curwin->w_p_cole > 0 && conceal_cursor_line(curwin)) {
redrawWinline(curwin, curwin->w_cursor.lnum);
}
if (VIsual_active) {
update_curbuf(INVERTED); // update inverted part
} else if (must_redraw) {