diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-04-27 18:35:25 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-02 13:11:47 +0200 |
commit | 3621604029119a8806da006eb0468cf65e23b980 (patch) | |
tree | 68f3cb7f23359dcd6a2285c82abe5c0e7c1638e4 /test/functional/legacy/scroll_opt_spec.lua | |
parent | 0bcf2a6382eca34a827b678987e03874001d9610 (diff) | |
download | rneovim-3621604029119a8806da006eb0468cf65e23b980.tar.gz rneovim-3621604029119a8806da006eb0468cf65e23b980.tar.bz2 rneovim-3621604029119a8806da006eb0468cf65e23b980.zip |
vim-patch:9.0.0900: cursor moves too far with 'smoothscroll'
Problem: Cursor moves too far with 'smoothscroll'.
Solution: Only move as far as really needed. (Yee Cheng Chin, closes vim/vim#11504)
https://github.com/vim/vim/commit/81ba26e9de24ca6b1c05b6ec03e53b21793f1a4b
Co-authored-by: Yee Cheng Chin <ychin.git@gmail.com>
Diffstat (limited to 'test/functional/legacy/scroll_opt_spec.lua')
-rw-r--r-- | test/functional/legacy/scroll_opt_spec.lua | 32 |
1 files changed, 21 insertions, 11 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua index 2f88221032..a05470418f 100644 --- a/test/functional/legacy/scroll_opt_spec.lua +++ b/test/functional/legacy/scroll_opt_spec.lua @@ -279,8 +279,8 @@ describe('smoothscroll', function() ]]) exec('call DoRel()') screen:expect([[ - 2<<<ong text very long text very long te| - ^xt very long text very long text ver| + 2<<<^ong text very long text very long te| + xt very long text very long text ver| y long text very long text very long| text very long text very long text | 1 three | @@ -380,8 +380,20 @@ describe('smoothscroll', function() screen:expect_unchanged() feed('G') screen:expect_unchanged() - -- moving cursor up - whole top line shows - feed('2k') + -- moving cursor up right after the >>> marker - no need to show whole line + feed('2gj3l2k') + screen:expect([[ + <<<^h some text with some text | + Line with some text with some text with | + some text with some text with some text | + with some text with some text | + Line with some text with some text with | + some text with some text with some text | + with some text with some text | + | + ]]) + -- moving cursor up where the >>> marker is - whole top line shows + feed('2j02k') screen:expect([[ ^Line with some text with some text with | some text with some text with some text | @@ -524,11 +536,9 @@ describe('smoothscroll', function() -- oldtest: Test_smoothscroll_long_line_showbreak() it("cursor is not one screen line too far down", function() screen:try_resize(40, 6) - exec([[ - " a line that spans four screen lines - call setline(1, 'with lots of text in one line '->repeat(6)) - set smoothscroll scrolloff=0 showbreak=+++\ - ]]) + -- a line that spans four screen lines + exec("call setline(1, 'with lots of text in one line '->repeat(6))") + exec('set smoothscroll scrolloff=0 showbreak=+++\\ ') local s1 = [[ ^with lots of text in one line with lots | +++ of text in one line with lots of tex| @@ -540,8 +550,8 @@ describe('smoothscroll', function() screen:expect(s1) feed('<C-E>') screen:expect([[ - +++ of text in one line with lots of tex| - +++ ^t in one line with lots of text in o| + +++ ^of text in one line with lots of tex| + +++ t in one line with lots of text in o| +++ ne line with lots of text in one lin| +++ e with lots of text in one line | ~ | |