Mercurial > vim
diff src/testdir/test_scroll_opt.vim @ 30733:5bea8e583d28 v9.0.0701
patch 9.0.0701: with 'smoothscroll' cursor position not adjusted in long line
Commit: https://github.com/vim/vim/commit/8cf3459878198c5bb4a96f3c63214b2beccce341
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Oct 8 21:13:40 2022 +0100
patch 9.0.0701: with 'smoothscroll' cursor position not adjusted in long line
Problem: With 'smoothscroll' the cursor position s not adjusted in a long
line.
Solution: Move the cursor further up or down in the line.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 08 Oct 2022 22:15:03 +0200 |
parents | a345ad853b08 |
children | fdc44acc3250 |
line wrap: on
line diff
--- a/src/testdir/test_scroll_opt.vim +++ b/src/testdir/test_scroll_opt.vim @@ -198,5 +198,33 @@ func Test_smoothscroll_wrap_scrolloff_ze call StopVimInTerminal(buf) endfunc +func Test_smoothscroll_wrap_long_line() + CheckScreendump + + let lines =<< trim END + vim9script + setline(1, ['one', 'two', 'Line' .. (' with lots of text'->repeat(30))]) + set smoothscroll scrolloff=0 + normal 3G10|zt + END + call writefile(lines, 'XSmoothWrap', 'D') + let buf = RunVimInTerminal('-S XSmoothWrap', #{rows: 6, cols: 40}) + call VerifyScreenDump(buf, 'Test_smooth_long_1', {}) + + " scrolling up, cursor moves screen line down + call term_sendkeys(buf, "\<C-E>") + call VerifyScreenDump(buf, 'Test_smooth_long_2', {}) + call term_sendkeys(buf, "5\<C-E>") + call VerifyScreenDump(buf, 'Test_smooth_long_3', {}) + + " scrolling down, cursor moves screen line up + call term_sendkeys(buf, "5\<C-Y>") + call VerifyScreenDump(buf, 'Test_smooth_long_4', {}) + call term_sendkeys(buf, "\<C-Y>") + call VerifyScreenDump(buf, 'Test_smooth_long_5', {}) + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab