patch 9.0.0893: 'smoothscroll' cursor calculations wrong when 'number' is set
Problem: 'smoothscroll' cursor calculations wrong when 'number' is set.
Solution: Correct the code that computes the width. (closes #11492)
diff --git a/src/move.c b/src/move.c
index 3a5f806..3c35946 100644
--- a/src/move.c
+++ b/src/move.c
@@ -1127,13 +1127,15 @@
&& curwin->w_skipcol > 0
&& curwin->w_wcol >= curwin->w_skipcol)
{
- // w_skipcol excludes win_col_off(). Include it here, since w_wcol
- // counts actual screen columns.
+ // Deduct by multiples of width2. This allows the long line
+ // wrapping formula below to correctly calculate the w_wcol value
+ // when wrapping.
if (curwin->w_skipcol <= width1)
- curwin->w_wcol -= curwin->w_width;
+ curwin->w_wcol -= width2;
else
- curwin->w_wcol -= curwin->w_width
+ curwin->w_wcol -= width2
* (((curwin->w_skipcol - width1) / width2) + 1);
+
did_sub_skipcol = TRUE;
}