diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-20 08:21:04 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-20 08:21:04 +0800 |
commit | d86a737df1e1c56c838d8e6109107b56000be226 (patch) | |
tree | 95b2d868504355e89385fb377b46527e8cf60087 /src | |
parent | 4c05b1a6ab32880bcc556cf4bf67f1f3edf0c480 (diff) | |
parent | cf0f83ebf0d74b11c1ffdc4d1066555f312a91ec (diff) | |
download | rneovim-d86a737df1e1c56c838d8e6109107b56000be226.tar.gz rneovim-d86a737df1e1c56c838d8e6109107b56000be226.tar.bz2 rneovim-d86a737df1e1c56c838d8e6109107b56000be226.zip |
Merge pull request #23686 from luukvbaal/smoothscroll
vim-patch:9.0.{1564,1568}
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/move.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index ead2b3b0d3..9e8abbcd96 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -248,7 +248,6 @@ void update_topline(win_T *wp) } linenr_T old_topline = wp->w_topline; - colnr_T old_skipcol = wp->w_skipcol; int old_topfill = wp->w_topfill; // If the buffer is empty, always set topline to 1. @@ -413,9 +412,11 @@ void update_topline(win_T *wp) dollar_vcol = -1; redraw_later(wp, UPD_VALID); - // Only reset w_skipcol if it was not just set to make cursor visible. - if (wp->w_skipcol == old_skipcol) { + // When 'smoothscroll' is not set, should reset w_skipcol. + if (!wp->w_p_sms) { reset_skipcol(wp); + } else if (wp->w_skipcol != 0) { + redraw_later(wp, UPD_SOME_VALID); } // May need to set w_skipcol when cursor in w_topline. @@ -660,7 +661,7 @@ static void curs_rows(win_T *wp) i--; // hold at inserted lines } } - if (valid && (lnum != wp->w_topline || !win_may_fill(wp))) { + if (valid && (lnum != wp->w_topline || (wp->w_skipcol == 0 && !win_may_fill(wp)))) { lnum = wp->w_lines[i].wl_lastlnum + 1; // Cursor inside folded lines, don't count this row if (lnum > wp->w_cursor.lnum) { |