aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua28
-rw-r--r--test/old/testdir/test_scroll_opt.vim12
2 files changed, 38 insertions, 2 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 31d851f571..e58b95ecc1 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -500,6 +500,34 @@ describe('smoothscroll', function()
exec('set scrolloff=0')
feed('0j')
screen:expect([[
+ <<<of text with lots of text with lots o|
+ f text with lots of text end |
+ ^four |
+ ~ |
+ ~ |
+ |
+ ]])
+ -- Test zt/zz/zb that they work properly when a long line is above it
+ 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 |
+ |
+ ]])
+ feed('zz')
+ screen:expect([[
+ <<<of text with lots of text with lots o|
+ f text with lots of text end |
+ ^four |
+ ~ |
+ ~ |
+ |
+ ]])
+ feed('zt')
+ screen:expect([[
^four |
~ |
~ |
diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim
index af46773ebf..3c95c36b4f 100644
--- a/test/old/testdir/test_scroll_opt.vim
+++ b/test/old/testdir/test_scroll_opt.vim
@@ -313,6 +313,14 @@ func Test_smoothscroll_wrap_long_line()
call term_sendkeys(buf, "0j")
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 VerifyScreenDump(buf, 'Test_smooth_long_11', {})
+ call term_sendkeys(buf, "zz")
+ call VerifyScreenDump(buf, 'Test_smooth_long_12', {})
+ call term_sendkeys(buf, "zt")
+ call VerifyScreenDump(buf, 'Test_smooth_long_13', {})
+
" Repeat the step and move the cursor down again.
" This time, use a shorter long line that is barely long enough to span more
" than one window. Note that the cursor is at the bottom this time because
@@ -320,7 +328,7 @@ func Test_smoothscroll_wrap_long_line()
call term_sendkeys(buf, ":call setline(1, ['one', 'two', 'Line' .. (' with lots of text'->repeat(10)) .. ' end', 'four'])\<CR>")
call term_sendkeys(buf, "3Gzt")
call term_sendkeys(buf, "j")
- call VerifyScreenDump(buf, 'Test_smooth_long_11', {})
+ call VerifyScreenDump(buf, 'Test_smooth_long_14', {})
" 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
@@ -328,7 +336,7 @@ func Test_smoothscroll_wrap_long_line()
" screen.
call term_sendkeys(buf, "3Gzt")
call term_sendkeys(buf, "\<C-E>j")
- call VerifyScreenDump(buf, 'Test_smooth_long_12', {})
+ call VerifyScreenDump(buf, 'Test_smooth_long_15', {})
call StopVimInTerminal(buf)
endfunc