diff options
author | zeertzjq <zeertzjq@outlook.com> | 2021-07-30 10:49:42 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2021-08-02 05:41:17 +0800 |
commit | 1666fe9dfe08201c92271b7a59fb2f96a20eb8db (patch) | |
tree | 4d1f9d0e574a13bf9e7c15a9ab2c30969713da2b /src/nvim/normal.c | |
parent | 337b1b31ac12ee4351668e32fe116282efd3dcc3 (diff) | |
download | rneovim-1666fe9dfe08201c92271b7a59fb2f96a20eb8db.tar.gz rneovim-1666fe9dfe08201c92271b7a59fb2f96a20eb8db.tar.bz2 rneovim-1666fe9dfe08201c92271b7a59fb2f96a20eb8db.zip |
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)
https://github.com/vim/vim/commit/017ba07fa2cdc578245618717229444fd50c470d
Diffstat (limited to 'src/nvim/normal.c')
-rw-r--r-- | src/nvim/normal.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/nvim/normal.c b/src/nvim/normal.c index 9185062f94..1471c16a9f 100644 --- a/src/nvim/normal.c +++ b/src/nvim/normal.c @@ -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(); } |