aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/terminal/edit_spec.lua3
-rw-r--r--test/functional/terminal/ex_terminal_spec.lua12
2 files changed, 14 insertions, 1 deletions
diff --git a/test/functional/terminal/edit_spec.lua b/test/functional/terminal/edit_spec.lua
index 9795e7957d..42a5c768bb 100644
--- a/test/functional/terminal/edit_spec.lua
+++ b/test/functional/terminal/edit_spec.lua
@@ -38,7 +38,8 @@ describe(':edit term://*', function()
meths.set_option('shellcmdflag', 'REP ' .. rep)
local rep_size = rep:byte() -- 'a' => 97
local sb = 10
- command('autocmd TermOpen * :setlocal scrollback='..tostring(sb))
+ command('autocmd TermOpen * :setlocal scrollback='..tostring(sb)
+ ..'|call feedkeys("G", "n")')
command('edit term://foobar')
local bufcontents = {}
diff --git a/test/functional/terminal/ex_terminal_spec.lua b/test/functional/terminal/ex_terminal_spec.lua
index dc2535bade..7a9d2a9b36 100644
--- a/test/functional/terminal/ex_terminal_spec.lua
+++ b/test/functional/terminal/ex_terminal_spec.lua
@@ -36,6 +36,18 @@ describe(':terminal', function()
]])
end)
+ it("in normal-mode :split does not move cursor", function()
+ execute([[terminal while true; do echo foo; sleep .1; done]])
+ helpers.feed([[<C-\><C-N>M]]) -- move cursor away from last line
+ wait()
+ eq(3, eval("line('$')")) -- window height
+ eq(2, eval("line('.')")) -- cursor is in the middle
+ execute('vsplit')
+ eq(2, eval("line('.')")) -- cursor stays where we put it
+ execute('split')
+ eq(2, eval("line('.')")) -- cursor stays where we put it
+ end)
+
end)
describe(':terminal (with fake shell)', function()