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)
diff --git a/src/move.c b/src/move.c
index 3f6802a..e435bb0 100644
--- a/src/move.c
+++ b/src/move.c
@@ -519,6 +519,8 @@
// 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 @@
--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;