vim-patch:9.0.1599: Cursor not adjusted when 'splitkeep' is not "cursor"

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 vim/vim#12480)

a109f39ef5
This commit is contained in:
luukvbaal
2023-06-02 17:26:41 +02:00
committed by zeertzjq
parent 00a0847675
commit 6809d3377c
4 changed files with 62 additions and 55 deletions

View File

@@ -1765,9 +1765,20 @@ endfunction
function 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