}
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
call StopVimInTerminal(buf)
endfunc
+func Test_smoothscroll_multibyte()
+ CheckScreendump
+
+ let lines =<< trim END
+ set scrolloff=0 smoothscroll
+ call setline(1, [repeat('ϛ', 45), repeat('2', 36)])
+ exe "normal G35l\<C-E>k"
+ END
+ call writefile(lines, 'XSmoothMultibyte', 'D')
+ let buf = RunVimInTerminal('-S XSmoothMultibyte', #{rows: 6, cols: 40})
+ call VerifyScreenDump(buf, 'Test_smoothscroll_multi_1', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
func Test_smoothscroll_number()
CheckScreendump