diff options
Diffstat (limited to 'src/nvim/match.c')
-rw-r--r-- | src/nvim/match.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/nvim/match.c b/src/nvim/match.c index 29d4b7c225..31a628bbff 100644 --- a/src/nvim/match.c +++ b/src/nvim/match.c @@ -42,7 +42,7 @@ # include "match.c.generated.h" #endif -static char *e_invalwindow = N_("E957: Invalid window number"); +static const char *e_invalwindow = N_("E957: Invalid window number"); #define SEARCH_HL_PRIORITY 0 @@ -938,10 +938,9 @@ void f_getmatches(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) tv_dict_add_list(dict, buf, (size_t)len, l); } } else { - tv_dict_add_str(dict, S_LEN("pattern"), (const char *)cur->mit_pattern); + tv_dict_add_str(dict, S_LEN("pattern"), cur->mit_pattern); } - tv_dict_add_str(dict, S_LEN("group"), - (const char *)syn_id2name(cur->mit_hlg_id)); + tv_dict_add_str(dict, S_LEN("group"), syn_id2name(cur->mit_hlg_id)); tv_dict_add_nr(dict, S_LEN("priority"), (varnumber_T)cur->mit_priority); tv_dict_add_nr(dict, S_LEN("id"), (varnumber_T)cur->mit_id); @@ -1166,9 +1165,8 @@ void f_matcharg(typval_T *argvars, typval_T *rettv, EvalFuncData fptr) matchitem_T *const m = get_match(curwin, id); if (m != NULL) { - tv_list_append_string(rettv->vval.v_list, - (const char *)syn_id2name(m->mit_hlg_id), -1); - tv_list_append_string(rettv->vval.v_list, (const char *)m->mit_pattern, -1); + tv_list_append_string(rettv->vval.v_list, syn_id2name(m->mit_hlg_id), -1); + tv_list_append_string(rettv->vval.v_list, m->mit_pattern, -1); } else { tv_list_append_string(rettv->vval.v_list, NULL, 0); tv_list_append_string(rettv->vval.v_list, NULL, 0); |