patch 9.1.1482: scrolling with 'splitkeep' and line()
Problem: Topline is preemptively updated by line() in WinResized
autocmd with 'splitkeep' != "cursor".
Solution: Set `skip_update_topline` when 'splitkeep' != "cursor".
(Luuk van Baal)
related: neovim/neovim#34666
closes: #17613
Signed-off-by: Luuk van Baal <luukvbaal@gmail.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index c5edb0d..4e02f00 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -2120,6 +2120,24 @@
call VerifyScreenDump(buf, 'Test_splitkeep_skipcol_1', {})
endfunc
+func Test_splitkeep_line()
+ CheckScreendump
+
+ let lines =<< trim END
+ set splitkeep=screen nosplitbelow
+ autocmd WinResized * call line('w0', 1000)
+ call setline(1, range(1000))
+ END
+
+ call writefile(lines, 'XTestSplitkeepSkipcol', 'D')
+ let buf = RunVimInTerminal('-S XTestSplitkeepSkipcol', #{rows: 6, cols: 40})
+
+ call VerifyScreenDump(buf, 'Test_splitkeep_line_1', {})
+
+ call term_sendkeys(buf, ":wincmd s\<CR>")
+ call VerifyScreenDump(buf, 'Test_splitkeep_line_2', {})
+endfunc
+
func Test_new_help_window_on_error()
help change.txt
execute "normal! /CTRL-@\<CR>"