summaryrefslogtreecommitdiffstats
path: root/src/testdir/test_window_cmd.vim
diff options
context:
space:
mode:
authorLuuk van Baal <luukvbaal@gmail.com>2023-06-02 14:16:35 +0100
committerBram Moolenaar <Bram@vim.org>2023-06-02 14:16:35 +0100
commita109f39ef54bc3894768170f02c1b6ac56164488 (patch)
tree2991683d08efbba19c489753c0c606c247860252 /src/testdir/test_window_cmd.vim
parent47eec6716b8621fd43bac8ecc9c19089df26705e (diff)
patch 9.0.1599: Cursor not adjusted when 'splitkeep' is not "cursor"v9.0.1599
Problem: Cursor not adjusted when near top or bottom of window and 'splitkeep' is not "cursor". Solution: Move boundary checks to outer cursor move functions, inner functions should only return valid cursor positions. (Luuk van Baal, closes #12480)
Diffstat (limited to 'src/testdir/test_window_cmd.vim')
-rw-r--r--src/testdir/test_window_cmd.vim13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/testdir/test_window_cmd.vim b/src/testdir/test_window_cmd.vim
index 549069080b..03c51e845a 100644
--- a/src/testdir/test_window_cmd.vim
+++ b/src/testdir/test_window_cmd.vim
@@ -1819,9 +1819,20 @@ endfunc
func Test_splitkeep_misc()
set splitkeep=screen
- set splitbelow
call setline(1, range(1, &lines))
+ " Cursor is adjusted to start and end of buffer
+ norm M
+ wincmd s
+ resize 1
+ call assert_equal(1, line('.'))
+ wincmd j
+ norm GM
+ resize 1
+ call assert_equal(&lines, line('.'))
+ only!
+
+ set splitbelow
norm Gzz
let top = line('w0')
" No scroll when aucmd_win is opened