vim-patch:8.1.2029: cannot control 'cursorline' highlighting well

Problem:    Cannot control 'cursorline' highlighting well.
Solution:   Add "screenline". (Christian Brabandt, closes vim/vim#4933)
017ba07fa2
This commit is contained in:
zeertzjq
2021-07-30 10:49:42 +08:00
parent 337b1b31ac
commit 1666fe9dfe
10 changed files with 305 additions and 47 deletions

View File

@@ -1275,10 +1275,25 @@ static void normal_redraw(NormalState *s)
redrawWinline(curwin, curwin->w_cursor.lnum);
}
if (curwin->w_p_cul && curwin->w_p_wrap
&& (curwin->w_p_culopt_flags & CULOPT_SCRLINE)) {
must_redraw = NOT_VALID;
}
if (VIsual_active) {
update_curbuf(INVERTED); // update inverted part
} else if (must_redraw) {
update_screen(0);
// Might need some more update for the cursorscreen line.
// TODO(vim): can we optimized this?
if (curwin->w_p_cul
&& curwin->w_p_wrap
&& (curwin->w_p_culopt_flags & CULOPT_SCRLINE)
&& !char_avail()) {
update_screen(VALID);
}
else {
update_screen(0);
}
} else if (redraw_cmdline || clear_cmdline) {
showmode();
}