aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/eval.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2023-12-06 16:49:40 +0800
committerGitHub <noreply@github.com>2023-12-06 16:49:40 +0800
commitf22e9e10f9ad77d2cce7f52837c5724877505a08 (patch)
tree0ef7ab588500f2d731fccd3a7aa43c9e51e1be32 /src/nvim/eval.c
parent401ce9f3fdebed05a929de1b94e55c74d45e2ffb (diff)
downloadrneovim-f22e9e10f9ad77d2cce7f52837c5724877505a08.tar.gz
rneovim-f22e9e10f9ad77d2cce7f52837c5724877505a08.tar.bz2
rneovim-f22e9e10f9ad77d2cce7f52837c5724877505a08.zip
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) https://github.com/vim/vim/commit/5c1ec439f0a69e9aa7ece9bbb7d916f48f58be1e Co-authored-by: Bram Moolenaar <Bram@vim.org>
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r--src/nvim/eval.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c
index 3ce6e98539..ac1461056c 100644
--- a/src/nvim/eval.c
+++ b/src/nvim/eval.c
@@ -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;