aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua42
-rw-r--r--test/old/testdir/test_scroll_opt.vim22
2 files changed, 64 insertions, 0 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 5c7c9cd55a..be7d324908 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -395,5 +395,47 @@ describe('smoothscroll', function()
f text wi^th lots of text with lots of te|
|
]])
+ -- 'scrolloff' set to 1, scrolling up, cursor moves screen line down
+ exec('set scrolloff=1')
+ feed('10|<C-E>')
+ 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 with lots of te|
+ xt with lots of text with lots of text w|
+ |
+ ]])
+ -- 'scrolloff' set to 1, scrolling down, cursor moves screen line up
+ feed('<C-E>gjgj<C-Y>')
+ 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 wi^th lots of text with lots of te|
+ xt with lots of text with lots of text w|
+ |
+ ]])
+ -- 'scrolloff' set to 2, scrolling up, cursor moves screen line down
+ exec('set scrolloff=2')
+ feed('10|<C-E>')
+ screen:expect([[
+ <<<th lots of text with lots of text wit|
+ h lots of text with lots of text with lo|
+ ts of tex^t with lots of text with lots o|
+ f text with lots of text with lots of te|
+ xt with lots of text with lots of text w|
+ |
+ ]])
+ -- 'scrolloff' set to 2, scrolling down, cursor moves screen line up
+ feed('<C-E>gjgj<C-Y>')
+ screen:expect([[
+ <<<of text with lots of text with lots o|
+ f text with lots of text with lots of te|
+ xt with l^ots of text with lots of text w|
+ ith lots of text with lots of text with |
+ lots of text with lots of text with lots|
+ |
+ ]])
end)
end)
diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim
index 0041fbaa25..3317ec9209 100644
--- a/test/old/testdir/test_scroll_opt.vim
+++ b/test/old/testdir/test_scroll_opt.vim
@@ -240,6 +240,28 @@ func Test_smoothscroll_wrap_long_line()
call term_sendkeys(buf, "\<C-Y>")
call VerifyScreenDump(buf, 'Test_smooth_long_5', {})
+ " 'scrolloff' set to 1, scrolling up, cursor moves screen line down
+ call term_sendkeys(buf, ":set scrolloff=1\<CR>")
+ call term_sendkeys(buf, "10|\<C-E>")
+ call VerifyScreenDump(buf, 'Test_smooth_long_6', {})
+
+ " 'scrolloff' set to 1, scrolling down, cursor moves screen line up
+ call term_sendkeys(buf, "\<C-E>")
+ call term_sendkeys(buf, "gjgj")
+ call term_sendkeys(buf, "\<C-Y>")
+ call VerifyScreenDump(buf, 'Test_smooth_long_7', {})
+
+ " 'scrolloff' set to 2, scrolling up, cursor moves screen line down
+ call term_sendkeys(buf, ":set scrolloff=2\<CR>")
+ call term_sendkeys(buf, "10|\<C-E>")
+ call VerifyScreenDump(buf, 'Test_smooth_long_8', {})
+
+ " 'scrolloff' set to 2, scrolling down, cursor moves screen line up
+ call term_sendkeys(buf, "\<C-E>")
+ call term_sendkeys(buf, "gj")
+ call term_sendkeys(buf, "\<C-Y>")
+ call VerifyScreenDump(buf, 'Test_smooth_long_9', {})
+
call StopVimInTerminal(buf)
endfunc