diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-10-08 21:13:40 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-10-08 21:13:40 +0100 |
commit | 8cf3459878198c5bb4a96f3c63214b2beccce341 (patch) | |
tree | 01a1000aa7e15f6577a2cd702043cf3675946870 /src/testdir/test_scroll_opt.vim | |
parent | 25f3a146a0e4c731b8608f4cfbbfdf7a71b2d05e (diff) |
patch 9.0.0701: with 'smoothscroll' cursor position not adjusted in long linev9.0.0701
Problem: With 'smoothscroll' the cursor position s not adjusted in a long
line.
Solution: Move the cursor further up or down in the line.
Diffstat (limited to 'src/testdir/test_scroll_opt.vim')
-rw-r--r-- | src/testdir/test_scroll_opt.vim | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim index 0292fa1f80..c369fa8642 100644 --- a/src/testdir/test_scroll_opt.vim +++ b/src/testdir/test_scroll_opt.vim @@ -198,5 +198,33 @@ func Test_smoothscroll_wrap_scrolloff_zero() 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 |