diff options
-rw-r--r-- | runtime/doc/terminal.txt | 3 | ||||
-rw-r--r-- | src/job.c | 5 | ||||
-rw-r--r-- | src/testdir/test_terminal.vim | 2 | ||||
-rw-r--r-- | src/version.c | 2 |
4 files changed, 11 insertions, 1 deletions
diff --git a/runtime/doc/terminal.txt b/runtime/doc/terminal.txt index 510f1c399..47b04df2f 100644 --- a/runtime/doc/terminal.txt +++ b/runtime/doc/terminal.txt @@ -871,7 +871,8 @@ term_start({cmd} [, {options}]) *term_start()* "term_name" name to use for the buffer name, instead of the command name. "term_rows" vertical size to use for the terminal, - instead of using 'termwinsize' + instead of using 'termwinsize'; valid + range is from zero to 1000 "term_cols" horizontal size to use for the terminal, instead of using 'termwinsize' "vertical" split the window vertically; note that @@ -432,6 +432,11 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2) opt->jo_term_rows = tv_get_number_chk(item, &error); if (error) return FAIL; + if (opt->jo_term_rows < 0 || opt->jo_term_rows > 1000) + { + semsg(_(e_invargval), "term_rows"); + return FAIL; + } } else if (STRCMP(hi->hi_key, "term_cols") == 0) { diff --git a/src/testdir/test_terminal.vim b/src/testdir/test_terminal.vim index 3e263efd2..cd7f477c2 100644 --- a/src/testdir/test_terminal.vim +++ b/src/testdir/test_terminal.vim @@ -467,6 +467,8 @@ func Test_terminal_size() bwipe! call assert_equal([7, 27], size) + call assert_fails("call term_start(cmd, {'term_rows': -1})", 'E475:') + call assert_fails("call term_start(cmd, {'term_rows': 1001})", 'E475:') if has('float') call assert_fails("call term_start(cmd, {'term_rows': 10.0})", 'E805:') endif diff --git a/src/version.c b/src/version.c index 4be3fd2f5..8e2a10b27 100644 --- a/src/version.c +++ b/src/version.c @@ -758,6 +758,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 3589, +/**/ 3588, /**/ 3587, |