aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2025-03-27 08:21:08 +0800
committerzeertzjq <zeertzjq@outlook.com>2025-03-27 08:25:12 +0800
commit797195e0ea554f2e546ced9104e8fbfa376f283f (patch)
tree6f487685c4e43e7419b0d8dc460507be674746e0 /src
parentf9280cde0ae12bcd68e069c3849b20f4fcfbd41a (diff)
downloadrneovim-797195e0ea554f2e546ced9104e8fbfa376f283f.tar.gz
rneovim-797195e0ea554f2e546ced9104e8fbfa376f283f.tar.bz2
rneovim-797195e0ea554f2e546ced9104e8fbfa376f283f.zip
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 https://github.com/vim/vim/commit/c4815c157b27923001e44bfd241fb540bf1fb518
Diffstat (limited to 'src')
-rw-r--r--src/nvim/eval.lua2
-rw-r--r--src/nvim/search.c6
2 files changed, 4 insertions, 4 deletions
diff --git a/src/nvim/eval.lua b/src/nvim/eval.lua
index f02f5179c7..ffdbacb2b4 100644
--- a/src/nvim/eval.lua
+++ b/src/nvim/eval.lua
@@ -7152,7 +7152,7 @@ M.funcs = {
returned. Zero means no limit.
camelcase Use enhanced camel case scoring making results
better suited for completion related to
- programming languages. Default is v:true
+ programming languages. Defaults to v:true.
If {list} is a list of dictionaries, then the optional {dict}
argument supports the following additional items:
diff --git a/src/nvim/search.c b/src/nvim/search.c
index fed8867315..fe8e54fed4 100644
--- a/src/nvim/search.c
+++ b/src/nvim/search.c
@@ -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);