mirror of
https://github.com/neovim/neovim.git
synced 2025-09-12 22:38:16 +00:00
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:
@@ -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
|
||||
///
|
||||
|
Reference in New Issue
Block a user