vim-patch:9.0.0002: map functionality outside of map.c (#19150)

Problem:    Map functionality outside of map.c.
Solution:   Move f_hasmapto() to map.c.  Rename a function. (closes vim/vim#10611)
c207fd2535
This commit is contained in:
zeertzjq
2022-06-29 19:25:38 +08:00
committed by GitHub
parent 21a1f1f552
commit bab32bba7a
4 changed files with 31 additions and 31 deletions

View File

@@ -4474,29 +4474,6 @@ static void f_haslocaldir(typval_T *argvars, typval_T *rettv, FunPtr fptr)
}
}
/// "hasmapto()" function
static void f_hasmapto(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{
const char *mode;
const char *const name = tv_get_string(&argvars[0]);
bool abbr = false;
char buf[NUMBUFLEN];
if (argvars[1].v_type == VAR_UNKNOWN) {
mode = "nvo";
} else {
mode = tv_get_string_buf(&argvars[1], buf);
if (argvars[2].v_type != VAR_UNKNOWN) {
abbr = tv_get_number(&argvars[2]);
}
}
if (map_to_exists(name, mode, abbr)) {
rettv->vval.v_number = true;
} else {
rettv->vval.v_number = false;
}
}
/// "histadd()" function
static void f_histadd(typval_T *argvars, typval_T *rettv, FunPtr fptr)
{