termopen(): remove name feature. #3181

Problem:  Commands like `:e term://top` display `term://.//PID:(null)`
instead of `term://.//PID:top`.

Solution: Remove the optional `name` argument (it allowed
ambiguous/potentially destructive cases, so it was problematic anyway).

Closes #3113
Closes #2924
This commit is contained in:
Mathieu Xhonneux 2015-08-16 16:14:24 +02:00 committed by Justin M. Keyes
parent 8229651087
commit 79b6ab21d8

View File

@ -16136,12 +16136,9 @@ static void f_termopen(typval_T *argvars, typval_T *rettv)
}
int pid = data->proc.pty.process.pid;
// Get the desired name of the buffer.
char *name = job_opts ?
(char *)get_dict_string(job_opts, (char_u *)"name", false) : cmd;
char buf[1024];
// format the title with the pid to conform with the term:// URI
snprintf(buf, sizeof(buf), "term://%s//%d:%s", cwd, pid, name);
// format the title with the pid to conform with the term:// URI
snprintf(buf, sizeof(buf), "term://%s//%d:%s", cwd, pid, cmd);
// at this point the buffer has no terminal instance associated yet, so unset
// the 'swapfile' option to ensure no swap file will be created
curbuf->b_p_swf = false;