Mercurial > vim
comparison 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 |
comparison
equal
deleted
inserted
replaced
12055:8dce424b095b | 12056:0498547dace0 |
---|---|
235 setup_job_options(jobopt_T *opt, int rows, int cols) | 235 setup_job_options(jobopt_T *opt, int rows, int cols) |
236 { | 236 { |
237 opt->jo_io_buf[PART_OUT] = curbuf->b_fnum; | 237 opt->jo_io_buf[PART_OUT] = curbuf->b_fnum; |
238 opt->jo_io_buf[PART_ERR] = curbuf->b_fnum; | 238 opt->jo_io_buf[PART_ERR] = curbuf->b_fnum; |
239 opt->jo_pty = TRUE; | 239 opt->jo_pty = TRUE; |
240 opt->jo_term_rows = rows; | 240 if ((opt->jo_set2 & JO2_TERM_ROWS) == 0) |
241 opt->jo_term_cols = cols; | 241 opt->jo_term_rows = rows; |
242 if ((opt->jo_set2 & JO2_TERM_COLS) == 0) | |
243 opt->jo_term_cols = cols; | |
242 } | 244 } |
243 | 245 |
244 static void | 246 static void |
245 term_start(char_u *cmd, jobopt_T *opt) | 247 term_start(char_u *cmd, jobopt_T *opt) |
246 { | 248 { |
2359 init_job_options(&opt); | 2361 init_job_options(&opt); |
2360 /* TODO: allow more job options */ | 2362 /* TODO: allow more job options */ |
2361 if (argvars[1].v_type != VAR_UNKNOWN | 2363 if (argvars[1].v_type != VAR_UNKNOWN |
2362 && get_job_options(&argvars[1], &opt, | 2364 && get_job_options(&argvars[1], &opt, |
2363 JO_TIMEOUT_ALL + JO_STOPONEXIT | 2365 JO_TIMEOUT_ALL + JO_STOPONEXIT |
2364 + JO_EXIT_CB + JO_CLOSE_CALLBACK | 2366 + JO_EXIT_CB + JO_CLOSE_CALLBACK, |
2365 + JO2_TERM_NAME + JO2_TERM_FINISH | 2367 JO2_TERM_NAME + JO2_TERM_FINISH |
2366 + JO2_CWD + JO2_ENV) == FAIL) | 2368 + JO2_TERM_COLS + JO2_TERM_ROWS + JO2_VERTICAL |
2367 return; | 2369 + JO2_CWD + JO2_ENV) == FAIL) |
2368 | 2370 return; |
2371 | |
2372 if (opt.jo_vertical) | |
2373 cmdmod.split = WSP_VERT; | |
2369 term_start(cmd, &opt); | 2374 term_start(cmd, &opt); |
2370 | 2375 |
2371 if (curbuf->b_term != NULL) | 2376 if (curbuf->b_term != NULL) |
2372 rettv->vval.v_number = curbuf->b_fnum; | 2377 rettv->vval.v_number = curbuf->b_fnum; |
2373 } | 2378 } |