0
0
mirror of https://github.com/vim/vim.git synced 2025-11-15 23:14:06 -05:00

patch 8.0.0916: cannot specify properties of window for terminal open

Problem:    Cannot specify properties of window for when opening a window for
            a finished terminal job.
Solution:   Add "term_opencmd".
This commit is contained in:
Bram Moolenaar
2017-08-12 16:01:04 +02:00
parent 7eedd4398a
commit 37c4583594
6 changed files with 56 additions and 6 deletions

View File

@@ -4434,6 +4434,28 @@ get_job_options(typval_T *tv, jobopt_T *opt, int supported, int supported2)
opt->jo_set2 |= JO2_TERM_FINISH;
opt->jo_term_finish = *val;
}
else if (STRCMP(hi->hi_key, "term_opencmd") == 0)
{
char_u *p;
if (!(supported2 & JO2_TERM_OPENCMD))
break;
opt->jo_set2 |= JO2_TERM_OPENCMD;
p = opt->jo_term_opencmd = get_tv_string_chk(item);
if (p != NULL)
{
/* Must have %d and no other %. */
p = vim_strchr(p, '%');
if (p != NULL && (p[1] != 'd'
|| vim_strchr(p + 2, '%') != NULL))
p = NULL;
}
if (p == NULL)
{
EMSG2(_(e_invarg2), "term_opencmd");
return FAIL;
}
}
else if (STRCMP(hi->hi_key, "term_rows") == 0)
{
if (!(supported2 & JO2_TERM_ROWS))