aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua80
-rw-r--r--test/old/testdir/test_scroll_opt.vim15
2 files changed, 81 insertions, 14 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 14dbe0caf9..20976089e2 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -31,11 +31,10 @@ describe('smoothscroll', function()
it('works with <C-E> and <C-E>', function()
exec([[
call setline(1, [ 'line one', 'word '->repeat(20), 'line three', 'long word '->repeat(7), 'line', 'line', 'line', ])
- set smoothscroll
+ set smoothscroll scrolloff=5
:5
]])
- local s0 = [[
- line one |
+ local s1 = [[
word word word word word word word word |
word word word word word word word word |
word word word word |
@@ -46,10 +45,10 @@ describe('smoothscroll', function()
line |
line |
~ |
+ ~ |
|
]]
- local s1 = [[
- word word word word word word word word |
+ local s2 = [[
word word word word word word word word |
word word word word |
line three |
@@ -60,10 +59,10 @@ describe('smoothscroll', function()
line |
~ |
~ |
+ ~ |
|
]]
- local s2 = [[
- word word word word word word word word |
+ local s3 = [[
word word word word |
line three |
long word long word long word long word |
@@ -74,36 +73,79 @@ describe('smoothscroll', function()
~ |
~ |
~ |
+ ~ |
|
]]
- local s3 = [[
- word word word word |
+ local s4 = [[
line three |
long word long word long word long word |
long word long word long word |
- ^line |
line |
line |
+ ^line |
+ ~ |
~ |
~ |
~ |
~ |
|
]]
- local s4 = [[
+ local s5 = [[
+ word word word word |
line three |
long word long word long word long word |
long word long word long word |
+ line |
+ line |
^line |
+ ~ |
+ ~ |
+ ~ |
+ ~ |
+ |
+ ]]
+ local s6 = [[
+ word word word word word word word word |
+ word word word word |
+ line three |
+ long word long word long word long word |
+ long word long word long word |
line |
line |
+ ^line |
~ |
~ |
~ |
+ |
+ ]]
+ local s7 = [[
+ word word word word word word word word |
+ word word word word word word word word |
+ word word word word |
+ line three |
+ long word long word long word long word |
+ long word long word long word |
+ line |
+ line |
+ ^line |
~ |
~ |
|
]]
+ local s8 = [[
+ line one |
+ word word word word word word word word |
+ word word word word word word word word |
+ word word word word |
+ line three |
+ long word long word long word long word |
+ long word long word long word |
+ line |
+ line |
+ ^line |
+ ~ |
+ |
+ ]]
feed('<C-E>')
screen:expect(s1)
feed('<C-E>')
@@ -113,12 +155,22 @@ describe('smoothscroll', function()
feed('<C-E>')
screen:expect(s4)
feed('<C-Y>')
- screen:expect(s3)
+ screen:expect(s5)
feed('<C-Y>')
- screen:expect(s2)
+ screen:expect(s6)
feed('<C-Y>')
+ screen:expect(s7)
+ feed('<C-Y>')
+ screen:expect(s8)
+ exec('set foldmethod=indent')
+ -- move the cursor so we can reuse the same dumps
+ feed('5G<C-E>')
screen:expect(s1)
+ feed('<C-E>')
+ screen:expect(s2)
+ feed('7G<C-Y>')
+ screen:expect(s7)
feed('<C-Y>')
- screen:expect(s0)
+ screen:expect(s8)
end)
end)
diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim
index ed3ffd83e7..c1f6c66642 100644
--- a/test/old/testdir/test_scroll_opt.vim
+++ b/test/old/testdir/test_scroll_opt.vim
@@ -105,6 +105,21 @@ func Test_smoothscroll_CtrlE_CtrlY()
call term_sendkeys(buf, "\<C-Y>")
call VerifyScreenDump(buf, 'Test_smoothscroll_8', {})
+ if has('folding')
+ call term_sendkeys(buf, ":set foldmethod=indent\<CR>")
+ " move the cursor so we can reuse the same dumps
+ call term_sendkeys(buf, "5G")
+ call term_sendkeys(buf, "\<C-E>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_1', {})
+ call term_sendkeys(buf, "\<C-E>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_2', {})
+ call term_sendkeys(buf, "7G")
+ call term_sendkeys(buf, "\<C-Y>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_7', {})
+ call term_sendkeys(buf, "\<C-Y>")
+ call VerifyScreenDump(buf, 'Test_smoothscroll_8', {})
+ endif
+
call StopVimInTerminal(buf)
endfunc