diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-08 15:51:14 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-05-08 15:51:14 +0100 |
commit | 3ce8c389155fc1257082cdb0cef7801b49f6aaf9 (patch) | |
tree | 6936b41f996acbafaa6f9ab9292b80378f45ba8e /src/testdir/test_scroll_opt.vim | |
parent | 8cf51376b842e0060edf08bd2e5bd9933c552ecf (diff) |
patch 9.0.1525: 'smoothscroll' does not always work properlyv9.0.1525
Problem: 'smoothscroll' does not always work properly.
Solution: Do not reset w_skipcol after it was intentionally set. (Luuk van
Baal, closes #12360, closes #12199, closes #12323)
Diffstat (limited to 'src/testdir/test_scroll_opt.vim')
-rw-r--r-- | src/testdir/test_scroll_opt.vim | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/testdir/test_scroll_opt.vim b/src/testdir/test_scroll_opt.vim index 95a4aedcb3..5f6fefeee7 100644 --- a/src/testdir/test_scroll_opt.vim +++ b/src/testdir/test_scroll_opt.vim @@ -638,4 +638,47 @@ func Test_smoothscroll_ins_lines() call StopVimInTerminal(buf) endfunc +" this placed the cursor in the command line +func Test_smoothscroll_cursormoved_line() + CheckScreendump + + let lines =<< trim END + set smoothscroll + call setline(1, [ + \'', + \'_'->repeat(&lines * &columns), + \(('_')->repeat(&columns - 2) .. 'xxx')->repeat(2) + \]) + autocmd CursorMoved * eval [line('w0'), line('w$')] + call search('xxx') + END + call writefile(lines, 'XSmoothCursorMovedLine', 'D') + let buf = RunVimInTerminal('-S XSmoothCursorMovedLine', #{rows: 6}) + + call VerifyScreenDump(buf, 'Test_smooth_cursormoved_line', {}) + + call StopVimInTerminal(buf) +endfunc + +func Test_smoothscroll_eob() + CheckScreendump + + let lines =<< trim END + set smoothscroll + call setline(1, ['']->repeat(100)) + norm G + END + call writefile(lines, 'XSmoothEob', 'D') + let buf = RunVimInTerminal('-S XSmoothEob', #{rows: 10}) + + " does not scroll halfway when scrolling to end of buffer + call VerifyScreenDump(buf, 'Test_smooth_eob_1', {}) + + " cursor is not placed below window + call term_sendkeys(buf, ":call setline(92, 'a'->repeat(100))\<CR>\<C-B>G") + call VerifyScreenDump(buf, 'Test_smooth_eob_2', {}) + + call StopVimInTerminal(buf) +endfunc + " vim: shiftwidth=2 sts=2 expandtab |