From d5780e133a030d3ae4a4985264412bdca06746d7 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Tue, 9 May 2023 22:41:02 +0200 Subject: [PATCH] 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 --- test/functional/legacy/scroll_opt_spec.lua | 33 +++++++++------------- test/old/testdir/test_scroll_opt.vim | 4 +-- 2 files changed, 15 insertions(+), 22 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([[ - <<repeat(10)) .. ' end', 'four'])") - feed('3Gztj') + feed('zb') screen:expect([[ <<repeat(10)) .. ' end', 'four'])") + feed('3Gztj') + 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.