aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-26 06:58:36 +0800
committerGitHub <noreply@github.com>2025-03-26 06:58:36 +0800
commita3b4743b4341d857ffc8a103f25ccb42ebc0e292 (patch)
tree2178e3b056b663a6d288413ebf0118e66b9929fc /test
parentd32780de4daff2351d7c2605ea6ba318f88fac2f (diff)
downloadrneovim-a3b4743b4341d857ffc8a103f25ccb42ebc0e292.tar.gz
rneovim-a3b4743b4341d857ffc8a103f25ccb42ebc0e292.tar.bz2
rneovim-a3b4743b4341d857ffc8a103f25ccb42ebc0e292.zip
vim-patch:9.1.1238: wrong cursor column with 'set splitkeep=screen' (#33060)
Problem: With ':set splitkeep=screen', cursor did't restore column correctly when splitting a window on a line longer than the last line on the screen (after v9.1.0707) Solution: Restore cursor column in `win_fix_scroll()` since it may be changed in `getvcol()` after 396fd1ec2956 (phanium). Example: ``` echo longlonglongling\nshort | vim - -u NONE --cmd 'set splitkeep=screen' +'norm $' +new +q ``` fixes: vim/vim#16968 closes: vim/vim#16971 https://github.com/vim/vim/commit/7746348c5d0f4c4707503f856d0335d8921e8d50 Co-authored-by: phanium <91544758+phanen@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r--test/old/testdir/test_window_cmd.vim12
1 files changed, 12 insertions, 0 deletions
diff --git a/test/old/testdir/test_window_cmd.vim b/test/old/testdir/test_window_cmd.vim
index 24517f90cb..3501672f95 100644
--- a/test/old/testdir/test_window_cmd.vim
+++ b/test/old/testdir/test_window_cmd.vim
@@ -1934,6 +1934,18 @@ func Test_splitkeep_misc()
set splitkeep&
endfunc
+func Test_splitkeep_screen_cursor_pos()
+ new
+ set splitkeep=screen
+ call setline(1, ["longer than the last", "shorter"])
+ norm! $
+ wincmd s
+ close
+ call assert_equal([0, 1, 20, 0], getpos('.'))
+ %bwipeout!
+ set splitkeep&
+endfunc
+
func Test_splitkeep_cursor()
CheckScreendump
let lines =<< trim END