mirror of
https://github.com/neovim/neovim.git
synced 2025-10-16 06:46:07 +00:00
vim-patch:9.1.1219: Strange error with wrong type for matchfuzzy() "camelcase"
Problem: Strange error with type for matchfuzzy() "camelcase".
Solution: Show the error "Invalid value for argument camelcase" instead
of "Invalid argument: camelcase" (zeertzjq).
Note that using tv_get_string() will lead to confusion, as when the
value cannot be converted to a string tv_get_string() will also give an
error about that, but "camelcase" takes a boolean, not a string. Also
don't use tv_get_string() for the "limit" argument above.
closes: vim/vim#16926
c4815c157b
This commit is contained in:
@@ -3466,7 +3466,7 @@ static void do_fuzzymatch(const typval_T *const argvars, typval_T *const rettv,
|
||||
if ((di = tv_dict_find(d, "key", -1)) != NULL) {
|
||||
if (di->di_tv.v_type != VAR_STRING || di->di_tv.vval.v_string == NULL
|
||||
|| *di->di_tv.vval.v_string == NUL) {
|
||||
semsg(_(e_invarg2), tv_get_string(&di->di_tv));
|
||||
semsg(_(e_invargNval), "key", tv_get_string(&di->di_tv));
|
||||
return;
|
||||
}
|
||||
key = tv_get_string(&di->di_tv);
|
||||
@@ -3477,7 +3477,7 @@ static void do_fuzzymatch(const typval_T *const argvars, typval_T *const rettv,
|
||||
|
||||
if ((di = tv_dict_find(d, "limit", -1)) != NULL) {
|
||||
if (di->di_tv.v_type != VAR_NUMBER) {
|
||||
semsg(_(e_invarg2), tv_get_string(&di->di_tv));
|
||||
semsg(_(e_invargval), "limit");
|
||||
return;
|
||||
}
|
||||
max_matches = (int)tv_get_number_chk(&di->di_tv, NULL);
|
||||
@@ -3485,7 +3485,7 @@ static void do_fuzzymatch(const typval_T *const argvars, typval_T *const rettv,
|
||||
|
||||
if ((di = tv_dict_find(d, "camelcase", -1)) != NULL) {
|
||||
if (di->di_tv.v_type != VAR_BOOL) {
|
||||
semsg(_(e_invarg2), "camelcase");
|
||||
semsg(_(e_invargval), "camelcase");
|
||||
return;
|
||||
}
|
||||
camelcase = tv_get_bool_chk(&di->di_tv, NULL);
|
||||
|
Reference in New Issue
Block a user