diff options
author | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-09 22:41:02 +0200 |
---|---|---|
committer | Luuk van Baal <luukvbaal@gmail.com> | 2023-05-09 22:53:08 +0200 |
commit | d5780e133a030d3ae4a4985264412bdca06746d7 (patch) | |
tree | 0ab46ba19a9f1803cace6d7308dac1e57ee2a388 | |
parent | 1caad791b4655c412c35279003641e5c4d9ed28d (diff) | |
download | rneovim-d5780e133a030d3ae4a4985264412bdca06746d7.tar.gz rneovim-d5780e133a030d3ae4a4985264412bdca06746d7.tar.bz2 rneovim-d5780e133a030d3ae4a4985264412bdca06746d7.zip |
vim-patch:9.0.1533: test for 'smoothscroll' is ineffective
Problem: Test for 'smoothscroll' is ineffective.
Solution: Change the order of testing "zb" and "zt". (Luuk van Baal,
closes vim/vim#12366)
https://github.com/vim/vim/commit/6f37e530d3e2d58ff055723047bf91d91af2632c
-rw-r--r-- | test/functional/legacy/scroll_opt_spec.lua | 29 | ||||
-rw-r--r-- | test/old/testdir/test_scroll_opt.vim | 4 |
2 files changed, 13 insertions, 20 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua index 869763be3c..e567d238b2 100644 --- a/test/functional/legacy/scroll_opt_spec.lua +++ b/test/functional/legacy/scroll_opt_spec.lua @@ -556,13 +556,13 @@ describe('smoothscroll', function() | ]]) -- Test zt/zz/zb that they work properly when a long line is above it - feed('zb') + feed('zt') screen:expect([[ - <<<th lots of text with lots of text wit| - h lots of text with lots of text with lo| - ts of text with lots of text with lots o| - f text with lots of text end | ^four | + ~ | + ~ | + ~ | + ~ | | ]]) feed('zz') @@ -574,13 +574,13 @@ describe('smoothscroll', function() ~ | | ]]) - feed('zt') + feed('zb') screen:expect([[ + <<<th lots of text with lots of text wit| + h lots of text with lots of text with lo| + ts of text with lots of text with lots o| + f text with lots of text end | ^four | - ~ | - ~ | - ~ | - ~ | | ]]) -- Repeat the step and move the cursor down again. @@ -589,14 +589,7 @@ describe('smoothscroll', function() -- Vim prefers to do so if we are scrolling a few lines only. exec("call setline(1, ['one', 'two', 'Line' .. (' with lots of text'->repeat(10)) .. ' end', 'four'])") feed('3Gztj') - screen:expect([[ - <<<th lots of text with lots of text wit| - h lots of text with lots of text with lo| - ts of text with lots of text with lots o| - f text with lots of text end | - ^four | - | - ]]) + screen:expect_unchanged() -- Repeat the step but this time start it when the line is smooth-scrolled by -- one line. This tests that the offset calculation is still correct and -- still end up scrolling down to the next line with cursor at bottom of diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim index 4edf9cc6f5..c0c3134ff4 100644 --- a/test/old/testdir/test_scroll_opt.vim +++ b/test/old/testdir/test_scroll_opt.vim @@ -323,11 +323,11 @@ func Test_smoothscroll_wrap_long_line() call VerifyScreenDump(buf, 'Test_smooth_long_10', {}) " Test zt/zz/zb that they work properly when a long line is above it - call term_sendkeys(buf, "zb") + call term_sendkeys(buf, "zt") call VerifyScreenDump(buf, 'Test_smooth_long_11', {}) call term_sendkeys(buf, "zz") call VerifyScreenDump(buf, 'Test_smooth_long_12', {}) - call term_sendkeys(buf, "zt") + call term_sendkeys(buf, "zb") call VerifyScreenDump(buf, 'Test_smooth_long_13', {}) " Repeat the step and move the cursor down again. |