patch 9.0.1612: "skipcol" not reset when using multi-byte characters
Problem: "skipcol" not reset when using multi-byte characters.
Solution: Compare with w_virtcol instead of w_cursor.col. (closes #12457)
diff --git a/src/move.c b/src/move.c
index 4cd4d1c..ea7d380 100644
--- a/src/move.c
+++ b/src/move.c
@@ -2414,10 +2414,14 @@
}
check_topfill(curwin, FALSE);
#endif
- // TODO: if the line doesn't fit may optimize w_skipcol
- if (curwin->w_topline == curwin->w_cursor.lnum
- && curwin->w_skipcol >= curwin->w_cursor.col)
- reset_skipcol();
+ if (curwin->w_topline == curwin->w_cursor.lnum)
+ {
+ validate_virtcol();
+ if (curwin->w_skipcol >= curwin->w_virtcol)
+ // TODO: if the line doesn't fit may optimize w_skipcol instead
+ // of making it zero
+ reset_skipcol();
+ }
if (curwin->w_topline != old_topline
|| curwin->w_skipcol != old_skipcol
#ifdef FEAT_DIFF