vim-patch:9.0.1599: Cursor not adjusted when 'splitkeep' is not "cursor" (#23884)

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 GitHub
parent aa130d0c7e
commit c45a111e35
4 changed files with 62 additions and 55 deletions

View File

@@ -1763,9 +1763,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