aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/legacy/scroll_opt_spec.lua24
-rw-r--r--test/functional/legacy/window_cmd_spec.lua25
-rw-r--r--test/old/testdir/test_scroll_opt.vim27
-rw-r--r--test/old/testdir/test_window_cmd.vim17
4 files changed, 92 insertions, 1 deletions
diff --git a/test/functional/legacy/scroll_opt_spec.lua b/test/functional/legacy/scroll_opt_spec.lua
index 8af23d2c26..c3c99b506b 100644
--- a/test/functional/legacy/scroll_opt_spec.lua
+++ b/test/functional/legacy/scroll_opt_spec.lua
@@ -695,6 +695,30 @@ describe('smoothscroll', function()
]])
end)
+ -- oldtest: Test_smoothscroll_ins_lines()
+ it("this was unnecessarily inserting lines", function()
+ screen:try_resize(40, 6)
+ exec([=[
+ set wrap smoothscroll scrolloff=0 conceallevel=2 concealcursor=nc
+ call setline(1, [
+ \'line one' .. 'with lots of text in one line '->repeat(2),
+ \'line two',
+ \'line three',
+ \'line four',
+ \'line five'
+ \])
+ ]=])
+ feed('<C-E>gjgk')
+ screen:expect([[
+ <<<lots of text in one line^ |
+ line two |
+ line three |
+ line four |
+ line five |
+ |
+ ]])
+ end)
+
it("works with virt_lines above and below", function()
screen:try_resize(55, 7)
exec([=[
diff --git a/test/functional/legacy/window_cmd_spec.lua b/test/functional/legacy/window_cmd_spec.lua
index 3a51f7a23f..373a9c7163 100644
--- a/test/functional/legacy/window_cmd_spec.lua
+++ b/test/functional/legacy/window_cmd_spec.lua
@@ -254,4 +254,29 @@ describe('splitkeep', function()
|
]])
end)
+
+ -- oldtest: Test_splitkeep_skipcol()
+ it('skipcol is not reset unnecessarily and is copied to new window', function()
+ screen:try_resize(40, 12)
+ exec([[
+ set splitkeep=topline smoothscroll splitbelow scrolloff=0
+ call setline(1, 'with lots of text in one line '->repeat(6))
+ norm 2
+ wincmd s
+ ]])
+ screen:expect([[
+ <<<e line with lots of text in one line |
+ with lots of text in one line with lots |
+ of text in one line |
+ ~ |
+ [No Name] [+] |
+ <<<e line with lots of text in one line |
+ ^with lots of text in one line with lots |
+ of text in one line |
+ ~ |
+ ~ |
+ [No Name] [+] |
+ |
+ ]])
+ end)
end)
diff --git a/test/old/testdir/test_scroll_opt.vim b/test/old/testdir/test_scroll_opt.vim
index 8402fa51e2..e8c4c71b60 100644
--- a/test/old/testdir/test_scroll_opt.vim
+++ b/test/old/testdir/test_scroll_opt.vim
@@ -587,7 +587,7 @@ func Test_smoothscroll_mouse_pos()
endfunc
" this was dividing by zero
-func Test_smoothscrol_zero_width()
+func Test_smoothscroll_zero_width()
CheckScreendump
let lines =<< trim END
@@ -613,5 +613,30 @@ func Test_smoothscrol_zero_width()
call StopVimInTerminal(buf)
endfunc
+" this was unnecessarily inserting lines
+func Test_smoothscroll_ins_lines()
+ CheckScreendump
+
+ let lines =<< trim END
+ set wrap
+ set smoothscroll
+ set scrolloff=0
+ set conceallevel=2
+ call setline(1, [
+ \'line one' .. 'with lots of text in one line '->repeat(2),
+ \'line two',
+ \'line three',
+ \'line four',
+ \'line five'
+ \])
+ END
+ call writefile(lines, 'XSmoothScrollInsLines', 'D')
+ let buf = RunVimInTerminal('-S XSmoothScrollInsLines', #{rows: 6, cols: 40})
+
+ call term_sendkeys(buf, "\<C-E>gjgk")
+ call VerifyScreenDump(buf, 'Test_smooth_ins_lines', {})
+
+ call StopVimInTerminal(buf)
+endfunc
" vim: shiftwidth=2 sts=2 expandtab
diff --git a/test/old/testdir/test_window_cmd.vim b/test/old/testdir/test_window_cmd.vim
index f18d1719c0..d4ff241366 100644
--- a/test/old/testdir/test_window_cmd.vim
+++ b/test/old/testdir/test_window_cmd.vim
@@ -1879,6 +1879,23 @@ func Test_splitkeep_status()
call StopVimInTerminal(buf)
endfunc
+" skipcol is not reset unnecessarily and is copied to new window
+func Test_splitkeep_skipcol()
+ CheckScreendump
+
+ let lines =<< trim END
+ set splitkeep=topline smoothscroll splitbelow scrolloff=0
+ call setline(1, 'with lots of text in one line '->repeat(6))
+ norm 2
+ wincmd s
+ END
+
+ call writefile(lines, 'XTestSplitkeepSkipcol', 'D')
+ let buf = RunVimInTerminal('-S XTestSplitkeepSkipcol', #{rows: 12, cols: 40})
+
+ call VerifyScreenDump(buf, 'Test_splitkeep_skipcol_1', {})
+endfunc
+
func Test_new_help_window_on_error()
help change.txt
execute "normal! /CTRL-@\<CR>"