vim-patch:8.1.0020: cannot tell whether a register is executing or recording

Problem:    Cannot tell whether a register is being used for executing or
            recording.
Solution:   Add reg_executing() and reg_recording(). (Hirohito Higashi,
            closes vim/vim#2745)  Rename the global variables for consistency.  Store
            the register name in reg_executing.
0b6d911e5d
This commit is contained in:
Jan Edmund Lazo
2019-05-26 19:39:38 -04:00
parent fb4d5a1846
commit 21f160746a
13 changed files with 83 additions and 21 deletions

View File

@@ -13556,6 +13556,26 @@ static void f_readfile(typval_T *argvars, typval_T *rettv, FunPtr fptr)
fclose(fd);
}
static void return_register(int regname, typval_T *rettv)
{
char_u buf[2] = {0, 0};
buf[0] = (char_u)regname;
rettv->v_type = VAR_STRING;
rettv->vval.v_string = vim_strsave(buf);
}
// "reg_executing()" function
static void f_reg_executing(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
return_register(reg_executing, rettv);
}
// "reg_recording()" function
static void f_reg_recording(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
return_register(reg_recording, rettv);
}
/// list2proftime - convert a List to proftime_T
///