summaryrefslogtreecommitdiff
path: root/src/testdir/test_terminal2.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-09-04 18:34:09 +0200
committerBram Moolenaar <Bram@vim.org>2020-09-04 18:34:09 +0200
commitb936b79424d435b83cdebed5507a9d3800e66e6c (patch)
treec7588f88311da5ef1d4217c94a9825174ca4e4c4 /src/testdir/test_terminal2.vim
parent077cc7aa0e0c431e97795612374fe17fe7c88803 (diff)
downloadvim-git-b936b79424d435b83cdebed5507a9d3800e66e6c.tar.gz
patch 8.2.1589: term_start() options for size are overruled by 'termwinsize'v8.2.1589
Problem: Term_start() options for size are overruled by 'termwinsize'. (Sergey Vlasov) Solution: Set 'termwinsize' to the specified size.
Diffstat (limited to 'src/testdir/test_terminal2.vim')
-rw-r--r--src/testdir/test_terminal2.vim31
1 files changed, 28 insertions, 3 deletions
diff --git a/src/testdir/test_terminal2.vim b/src/testdir/test_terminal2.vim
index 93ace42d8..f9f221b5c 100644
--- a/src/testdir/test_terminal2.vim
+++ b/src/testdir/test_terminal2.vim
@@ -109,6 +109,27 @@ func Test_terminal_termwinsize_minimum()
set termwinsize=
endfunc
+func Test_terminal_termwinsize_overruled()
+ let cmd = GetDummyCmd()
+ set termwinsize=5x43
+ let buf = term_start(cmd, #{term_rows: 7, term_cols: 50})
+ call TermWait(buf)
+ call assert_equal([7, 50], term_getsize(buf))
+ exe "bwipe! " .. buf
+
+ let buf = term_start(cmd, #{term_cols: 50})
+ call TermWait(buf)
+ call assert_equal([5, 50], term_getsize(buf))
+ exe "bwipe! " .. buf
+
+ let buf = term_start(cmd, #{term_rows: 7})
+ call TermWait(buf)
+ call assert_equal([7, 43], term_getsize(buf))
+ exe "bwipe! " .. buf
+
+ set termwinsize=
+endfunc
+
func Test_terminal_termwinkey()
" make three tabpages, terminal in the middle
0tabnew
@@ -397,13 +418,17 @@ func Test_terminal_does_not_truncate_last_newlines()
call delete('Xfile')
endfunc
-func Test_terminal_no_job()
+func GetDummyCmd()
if has('win32')
- let cmd = 'cmd /c ""'
+ return 'cmd /c ""'
else
CheckExecutable false
- let cmd = 'false'
+ return 'false'
endif
+endfunc
+
+func Test_terminal_no_job()
+ let cmd = GetDummyCmd()
let term = term_start(cmd, {'term_finish': 'close'})
call WaitForAssert({-> assert_equal(v:null, term_getjob(term)) })
endfunc