diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-06 19:24:45 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-07 00:38:45 +0200 |
commit | 8e74569d7ee170b8661bdc74d61cf6be95303060 (patch) | |
tree | 024921e7f0be9c6779d9e3da28b23a1e16fcfae0 /test | |
parent | 3b2bd8d69e6c0a173562778fae6ece67d9adf52c (diff) | |
download | rneovim-8e74569d7ee170b8661bdc74d61cf6be95303060.tar.gz rneovim-8e74569d7ee170b8661bdc74d61cf6be95303060.tar.bz2 rneovim-8e74569d7ee170b8661bdc74d61cf6be95303060.zip |
vim-patch:9.0.1513: text scrolls unnecessarily when splitting
Problem: Text scrolls unnecessarily when splitting and 'splitkeep' is not
"cursor".
Solution: Avoid resetting w_skipcol. (Luuk van Baal, closes vim/vim#12334)
https://github.com/vim/vim/commit/b926bf47d61360a4ec5e4867714a08d70fd49965
Diffstat (limited to 'test')
-rw-r--r-- | test/functional/legacy/window_cmd_spec.lua | 25 | ||||
-rw-r--r-- | test/old/testdir/test_window_cmd.vim | 17 |
2 files changed, 42 insertions, 0 deletions
diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua index 3a51f7a23f..373a9c7163 100644 --- a/test/functional/legacy/window_cmd_spec.lua +++ b/test/functional/legacy/window_cmd_spec.lua @@ -254,4 +254,29 @@ describe('splitkeep', function() | ]]) end) + + -- oldtest: Test_splitkeep_skipcol() + it('skipcol is not reset unnecessarily and is copied to new window', function() + screen:try_resize(40, 12) + exec([[ + set splitkeep=topline smoothscroll splitbelow scrolloff=0 + call setline(1, 'with lots of text in one line '->repeat(6)) + norm 2 + wincmd s + ]]) + screen:expect([[ + <<<e line with lots of text in one line | + with lots of text in one line with lots | + of text in one line | + ~ | + [No Name] [+] | + <<<e line with lots of text in one line | + ^with lots of text in one line with lots | + of text in one line | + ~ | + ~ | + [No Name] [+] | + | + ]]) + end) end) diff --git a/test/old/testdir/test_window_cmd.vim b/test/old/testdir/test_window_cmd.vim index f18d1719c0..d4ff241366 100644 --- a/test/old/testdir/test_window_cmd.vim +++ b/test/old/testdir/test_window_cmd.vim @@ -1879,6 +1879,23 @@ func Test_splitkeep_status() call StopVimInTerminal(buf) endfunc +" skipcol is not reset unnecessarily and is copied to new window +func Test_splitkeep_skipcol() + CheckScreendump + + let lines =<< trim END + set splitkeep=topline smoothscroll splitbelow scrolloff=0 + call setline(1, 'with lots of text in one line '->repeat(6)) + norm 2 + wincmd s + END + + call writefile(lines, 'XTestSplitkeepSkipcol', 'D') + let buf = RunVimInTerminal('-S XTestSplitkeepSkipcol', #{rows: 12, cols: 40}) + + call VerifyScreenDump(buf, 'Test_splitkeep_skipcol_1', {}) +endfunc + func Test_new_help_window_on_error() help change.txt execute "normal! /CTRL-@\<CR>" |