Mercurial > vim
diff src/move.c @ 32473:c89816c3e2d7 v9.0.1568
patch 9.0.1568: with 'smoothscroll' cursor may move below botline
Commit: https://github.com/vim/vim/commit/d49f646bf56b29d44bbb16e79bc877b59aab38ac
Author: Luuk van Baal <luukvbaal@gmail.com>
Date: Fri May 19 14:04:47 2023 +0100
patch 9.0.1568: with 'smoothscroll' cursor may move below botline
Problem: With 'smoothscroll' cursor may move below botline.
Solution: Call redraw_later() if needed, Compute cursor row with adjusted
condition. (Luuk van Baal, closes #12415)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 19 May 2023 15:15:05 +0200 |
parents | 83074077c0b1 |
children | c8b28054caec |
line wrap: on
line diff
--- a/src/move.c +++ b/src/move.c @@ -519,6 +519,8 @@ update_topline(void) // When 'smoothscroll' is not set, should reset w_skipcol. if (!curwin->w_p_sms) reset_skipcol(); + else if (curwin->w_skipcol != 0) + redraw_later(UPD_SOME_VALID); // May need to set w_skipcol when cursor in w_topline. if (curwin->w_cursor.lnum == curwin->w_topline) @@ -892,10 +894,11 @@ curs_rows(win_T *wp) --i; // hold at inserted lines } if (valid + && (lnum != wp->w_topline || (wp->w_skipcol == 0 #ifdef FEAT_DIFF - && (lnum != wp->w_topline || !wp->w_p_diff) + && !wp->w_p_diff #endif - ) + ))) { #ifdef FEAT_FOLDING lnum = wp->w_lines[i].wl_lastlnum + 1;