From 8faa4af39673ac032362b62662eb049f588fef81 Mon Sep 17 00:00:00 2001 From: ZyX Date: Thu, 23 Feb 2017 01:27:45 +0300 Subject: api: Rename dict_set_value to dict_set_var MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reasonings: 1. It is not used for anything, but scope dictionaries currenly. So there is no need to generalize and split it into dict_set_var (which will contain some scope-dictionary-specific checks) and dict_set_value (which will work for any dictionary). 2. Check for key size is no longer valid for non-scope dictionaries: you *can* use empty keys there. In scope dictionaries also, but you actually are not supposed to store there anything, but variables. Note that actually one may still do let b:[''] = 1 and “bypass” check for variable name. It won’t change what `echo b:` will show, but it may affect code which iterates over scope dictionary keys and sets them to something (if there is such code). --- src/nvim/eval.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/nvim/eval.c') diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 9b1c0fde1a..d5586b4630 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -17731,10 +17731,10 @@ static void f_termopen(typval_T *argvars, typval_T *rettv, FunPtr fptr) (void)setfname(curbuf, (uint8_t *)buf, NULL, true); // Save the job id and pid in b:terminal_job_{id,pid} Error err; - dict_set_value(curbuf->b_vars, cstr_as_string("terminal_job_id"), - INTEGER_OBJ(rettv->vval.v_number), false, false, &err); - dict_set_value(curbuf->b_vars, cstr_as_string("terminal_job_pid"), - INTEGER_OBJ(pid), false, false, &err); + dict_set_var(curbuf->b_vars, cstr_as_string("terminal_job_id"), + INTEGER_OBJ(rettv->vval.v_number), false, false, &err); + dict_set_var(curbuf->b_vars, cstr_as_string("terminal_job_pid"), + INTEGER_OBJ(pid), false, false, &err); Terminal *term = terminal_open(topts); data->term = term; -- cgit