}
check_topfill(curwin, FALSE);
#endif
- if (curwin->w_topline == curwin->w_cursor.lnum)
+ if (curwin->w_topline != old_topline)
+ reset_skipcol();
+ else if (curwin->w_topline == curwin->w_cursor.lnum)
{
validate_virtcol();
if (curwin->w_skipcol >= curwin->w_virtcol)
--- /dev/null
+| +0&#ffffff0@39
+|[+1&&|N|o| |N|a|m|e|]| @30
+|l+0&&|i|n|e|1| @34
+|l|i|n|e|2| @34
+>l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3
+|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3
+|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3|l|i|n|e|3| @19
+|l|i|n|e|4| @34
+|~+0#4040ff13&| @38
+|~| @38
+|[+3#0000000&|N|o| |N|a|m|e|]| |[|+|]| @26
+| +0&&@39
call StopVimInTerminal(buf)
endfunc
+" scroll_cursor_top() should reset skipcol when it changes topline
+func Test_smoothscroll_cursor_top()
+ CheckScreendump
+
+ let lines =<< trim END
+ set smoothscroll scrolloff=2
+ new | 11resize | wincmd j
+ call setline(1, ['line1', 'line2', 'line3'->repeat(20), 'line4'])
+ exe "norm G3\<C-E>k"
+ END
+ call writefile(lines, 'XSmoothScrollCursorTop', 'D')
+ let buf = RunVimInTerminal('-u NONE -S XSmoothScrollCursorTop', #{rows: 12, cols:40})
+ call VerifyScreenDump(buf, 'Test_smoothscroll_cursor_top', {})
+
+ call StopVimInTerminal(buf)
+endfunc
+
" vim: shiftwidth=2 sts=2 expandtab