1
0
forked from aniani/vim

patch 9.0.0671: negative topline using CTRL-Y with 'smoothscroll' and 'diff'

Problem:    Negative topline using CTRL-Y with 'smoothscroll' and 'diff'.
            (Ernie Rael)
Solution:   Only use 'smoothscroll' when 'wrap' is set.
This commit is contained in:
Bram Moolenaar
2022-10-06 13:09:17 +01:00
parent c9f5f73206
commit 1a58e1d97c
4 changed files with 47 additions and 11 deletions

View File

@@ -141,6 +141,32 @@ func Test_smoothscroll_number()
call StopVimInTerminal(buf)
endfunc
func Test_smoothscroll_diff_mode()
CheckScreendump
let lines =<< trim END
vim9script
var text = 'just some text here'
setline(1, text)
set smoothscroll
diffthis
new
setline(1, text)
set smoothscroll
diffthis
END
call writefile(lines, 'XSmoothDiff', 'D')
let buf = RunVimInTerminal('-S XSmoothDiff', #{rows: 8})
call VerifyScreenDump(buf, 'Test_smooth_diff_1', {})
call term_sendkeys(buf, "\<C-Y>")
call VerifyScreenDump(buf, 'Test_smooth_diff_1', {})
call term_sendkeys(buf, "\<C-E>")
call VerifyScreenDump(buf, 'Test_smooth_diff_1', {})
call StopVimInTerminal(buf)
endfunc
" vim: shiftwidth=2 sts=2 expandtab