vim-patch:8.2.3695: confusing error for missing key (#26420)

Problem:    Confusing error for missing key.
Solution:   Use the actualy key for the error. (closes vim/vim#9241)

5c1ec439f0

Co-authored-by: Bram Moolenaar <Bram@vim.org>
This commit is contained in:
zeertzjq
2023-12-06 16:49:40 +08:00
committed by GitHub
parent 401ce9f3fd
commit f22e9e10f9
4 changed files with 26 additions and 2 deletions

View File

@@ -3735,7 +3735,11 @@ static int eval_index_inner(typval_T *rettv, bool is_range, typval_T *var1, typv
dictitem_T *const item = tv_dict_find(rettv->vval.v_dict, key, keylen);
if (item == NULL && verbose) {
semsg(_(e_dictkey), key);
if (keylen > 0) {
semsg(_(e_dictkey_len), keylen, key);
} else {
semsg(_(e_dictkey), key);
}
}
if (item == NULL || tv_is_luafunc(&item->di_tv)) {
return FAIL;