diff src/terminal.c @ 12056:0498547dace0 v8.0.0908

patch 8.0.0908: cannot set terminal size with options commit https://github.com/vim/vim/commit/08d384ff3aa0366c18fb87ed215b1b4bdf9b1745 Author: Bram Moolenaar <Bram@vim.org> Date: Fri Aug 11 21:51:23 2017 +0200 patch 8.0.0908: cannot set terminal size with options Problem: Cannot set terminal size with options. Solution: Add "term_rows", "term_cols" and "vertical".
author Christian Brabandt <cb@256bit.org>
date Fri, 11 Aug 2017 22:00:05 +0200
parents 2796a2c9fc17
children a879814b8a37
line wrap: on
line diff
--- a/src/terminal.c
+++ b/src/terminal.c
@@ -237,8 +237,10 @@ setup_job_options(jobopt_T *opt, int row
     opt->jo_io_buf[PART_OUT] = curbuf->b_fnum;
     opt->jo_io_buf[PART_ERR] = curbuf->b_fnum;
     opt->jo_pty = TRUE;
-    opt->jo_term_rows = rows;
-    opt->jo_term_cols = cols;
+    if ((opt->jo_set2 & JO2_TERM_ROWS) == 0)
+	opt->jo_term_rows = rows;
+    if ((opt->jo_set2 & JO2_TERM_COLS) == 0)
+	opt->jo_term_cols = cols;
 }
 
     static void
@@ -2361,11 +2363,14 @@ f_term_start(typval_T *argvars, typval_T
     if (argvars[1].v_type != VAR_UNKNOWN
 	    && get_job_options(&argvars[1], &opt,
 		JO_TIMEOUT_ALL + JO_STOPONEXIT
-		+ JO_EXIT_CB + JO_CLOSE_CALLBACK
-		+ JO2_TERM_NAME + JO2_TERM_FINISH
-		+ JO2_CWD + JO2_ENV) == FAIL)
+		    + JO_EXIT_CB + JO_CLOSE_CALLBACK,
+		JO2_TERM_NAME + JO2_TERM_FINISH
+		    + JO2_TERM_COLS + JO2_TERM_ROWS + JO2_VERTICAL
+		    + JO2_CWD + JO2_ENV) == FAIL)
 	return;
 
+    if (opt.jo_vertical)
+	cmdmod.split = WSP_VERT;
     term_start(cmd, &opt);
 
     if (curbuf->b_term != NULL)