diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-11 20:29:09 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-11 20:57:31 +0200 |
commit | 15c684b358b0165d0874ba08ab6ac0976c86cc0f (patch) | |
tree | d9dbcae6d9b7e9c36d5fd792010d72e679d47a54 /src | |
parent | d5780e133a030d3ae4a4985264412bdca06746d7 (diff) | |
download | rneovim-15c684b358b0165d0874ba08ab6ac0976c86cc0f.tar.gz rneovim-15c684b358b0165d0874ba08ab6ac0976c86cc0f.tar.bz2 rneovim-15c684b358b0165d0874ba08ab6ac0976c86cc0f.zip |
vim-patch:9.0.1542: line not fully displayed if it doesn't fit in the screen
Problem: Line not fully displayed if it doesn't fit in the screen.
Solution: Do not reset s_skipcol if not needed. (Luuk van Baal,
closes vim/vim#12376)
https://github.com/vim/vim/commit/6c018680be0ec25d42614a93be1ea08df29a9e2a
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/move.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/nvim/move.c b/src/nvim/move.c index 9e053b2db5..ada6d004e8 100644 --- a/src/nvim/move.c +++ b/src/nvim/move.c @@ -2090,10 +2090,9 @@ void scroll_cursor_halfway(bool atend, bool prefer_above) colnr_T skipcol = 0; int want_height; - bool smooth_scroll = false; - if (curwin->w_p_sms && curwin->w_p_wrap) { + bool do_sms = curwin->w_p_wrap && curwin->w_p_sms; + if (do_sms) { // 'smoothscroll' and 'wrap' are set - smooth_scroll = true; if (atend) { want_height = (curwin->w_height_inner - used) / 2; used = 0; @@ -2106,7 +2105,7 @@ void scroll_cursor_halfway(bool atend, bool prefer_above) while (topline > 1) { // If using smoothscroll, we can precisely scroll to the // exact point where the cursor is halfway down the screen. - if (smooth_scroll) { + if (do_sms) { topline_back_winheight(curwin, &loff, false); if (loff.height == MAXCOL) { break; @@ -2190,7 +2189,7 @@ void scroll_cursor_halfway(bool atend, bool prefer_above) if (skipcol != 0) { curwin->w_skipcol = skipcol; redraw_later(curwin, UPD_NOT_VALID); - } else { + } else if (do_sms) { reset_skipcol(curwin); } } |