1
0
forked from aniani/vim

patch 9.0.1568: with 'smoothscroll' cursor may move below botline

Problem:    With 'smoothscroll' cursor may move below botline.
Solution:   Call redraw_later() if needed,  Compute cursor row with adjusted
            condition. (Luuk van Baal, closes #12415)
This commit is contained in:
Luuk van Baal
2023-05-19 14:04:47 +01:00
committed by Bram Moolenaar
parent d13c254d10
commit d49f646bf5
9 changed files with 75 additions and 9 deletions

View File

@@ -257,11 +257,14 @@ func Test_smoothscroll_wrap_scrolloff_zero()
call term_sendkeys(buf, "G")
call VerifyScreenDump(buf, 'Test_smooth_wrap_4', {})
" moving cursor up right after the >>> marker - no need to show whole line
call term_sendkeys(buf, "4\<C-Y>G")
call VerifyScreenDump(buf, 'Test_smooth_wrap_4', {})
" moving cursor up right after the <<< marker - no need to show whole line
call term_sendkeys(buf, "2gj3l2k")
call VerifyScreenDump(buf, 'Test_smooth_wrap_5', {})
" moving cursor up where the >>> marker is - whole top line shows
" moving cursor up where the <<< marker is - whole top line shows
call term_sendkeys(buf, "2j02k")
call VerifyScreenDump(buf, 'Test_smooth_wrap_6', {})
@@ -705,4 +708,30 @@ func Test_smoothscroll_eob()
call StopVimInTerminal(buf)
endfunc
" skipcol should not reset when doing incremental search on the same word
func Test_smoothscroll_incsearch()
CheckScreendump
let lines =<< trim END
set smoothscroll number scrolloff=0 incsearch
call setline(1, repeat([''], 20))
call setline(11, repeat('a', 100))
call setline(14, 'bbbb')
END
call writefile(lines, 'XSmoothIncsearch', 'D')
let buf = RunVimInTerminal('-S XSmoothIncsearch', #{rows: 8, cols:40})
call term_sendkeys(buf, "/b")
call VerifyScreenDump(buf, 'Test_smooth_incsearch_1', {})
call term_sendkeys(buf, "b")
call VerifyScreenDump(buf, 'Test_smooth_incsearch_2', {})
call term_sendkeys(buf, "b")
call VerifyScreenDump(buf, 'Test_smooth_incsearch_3', {})
call term_sendkeys(buf, "b")
call VerifyScreenDump(buf, 'Test_smooth_incsearch_4', {})
call term_sendkeys(buf, "\<CR>")
call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2 expandtab