aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/functional/lua/vim_spec.lua14
-rw-r--r--test/old/testdir/test_execute_func.vim22
2 files changed, 36 insertions, 0 deletions
diff --git a/test/functional/lua/vim_spec.lua b/test/functional/lua/vim_spec.lua
index a262d239e8..add3df6d8a 100644
--- a/test/functional/lua/vim_spec.lua
+++ b/test/functional/lua/vim_spec.lua
@@ -3664,6 +3664,20 @@ describe('lua stdlib', function()
]]
)
end)
+
+ it('layout in current tabpage does not affect windows in others', function()
+ command('tab split')
+ local t2_move_win = api.nvim_get_current_win()
+ command('vsplit')
+ local t2_other_win = api.nvim_get_current_win()
+ command('tabprevious')
+ matches('E36: Not enough room$', pcall_err(command, 'execute "split|"->repeat(&lines)'))
+ command('vsplit')
+
+ -- Without vim-patch:8.2.3862, this gives E36, despite just the 1st tabpage being full.
+ exec_lua('vim.api.nvim_win_call(..., function() vim.cmd.wincmd "J" end)', t2_move_win)
+ eq({ 'col', { { 'leaf', t2_other_win }, { 'leaf', t2_move_win } } }, fn.winlayout(2))
+ end)
end)
describe('vim.iconv', function()
diff --git a/test/old/testdir/test_execute_func.vim b/test/old/testdir/test_execute_func.vim
index 2edae39b8f..d9909e92a6 100644
--- a/test/old/testdir/test_execute_func.vim
+++ b/test/old/testdir/test_execute_func.vim
@@ -3,6 +3,7 @@
source view_util.vim
source check.vim
source vim9.vim
+source term_util.vim
func NestedEval()
let nested = execute('echo "nested\nlines"')
@@ -177,6 +178,27 @@ func Test_win_execute_visual_redraw()
bwipe!
endfunc
+func Test_win_execute_on_startup()
+ CheckRunVimInTerminal
+
+ let lines =<< trim END
+ vim9script
+ [repeat('x', &columns)]->writefile('Xfile1')
+ silent tabedit Xfile2
+ var id = win_getid()
+ silent tabedit Xfile3
+ autocmd VimEnter * win_execute(id, 'close')
+ END
+ call writefile(lines, 'XwinExecute')
+ let buf = RunVimInTerminal('-p Xfile1 -Nu XwinExecute', {})
+
+ " this was crashing on exit with EXITFREE defined
+ call StopVimInTerminal(buf)
+
+ call delete('XwinExecute')
+ call delete('Xfile1')
+endfunc
+
func Test_execute_cmd_with_null()
call assert_equal("", execute(v:_null_string))
call assert_equal("", execute(v:_null_list))