patch 9.0.1543: display errors when making topline shorter
Problem: Display errors when making topline shorter and 'smoothscroll' is
set.
Solution: Reset w_skipcol when the topline becomes shorter than its current
value. (Luuk van Baal, closes #12367)
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim
index 62469de..c12da97 100644
--- a/src/testdir/test_scroll_opt.vim
+++ b/src/testdir/test_scroll_opt.vim
@@ -335,9 +335,12 @@
" than one window. Note that the cursor is at the bottom this time because
" Vim prefers to do so if we are scrolling a few lines only.
call term_sendkeys(buf, ":call setline(1, ['one', 'two', 'Line' .. (' with lots of text'->repeat(10)) .. ' end', 'four'])\<CR>")
+ " Currently visible lines were replaced, test that the lines and cursor
+ " are correctly displayed.
+ call VerifyScreenDump(buf, 'Test_smooth_long_14', {})
call term_sendkeys(buf, "3Gzt")
call term_sendkeys(buf, "j")
- call VerifyScreenDump(buf, 'Test_smooth_long_14', {})
+ call VerifyScreenDump(buf, 'Test_smooth_long_15', {})
" Repeat the step but this time start it when the line is smooth-scrolled by
" one line. This tests that the offset calculation is still correct and
@@ -345,7 +348,7 @@
" screen.
call term_sendkeys(buf, "3Gzt")
call term_sendkeys(buf, "\<C-E>j")
- call VerifyScreenDump(buf, 'Test_smooth_long_15', {})
+ call VerifyScreenDump(buf, 'Test_smooth_long_16', {})
call StopVimInTerminal(buf)
endfunc