Mercurial > vim
comparison src/eval.c @ 26329:8afd7aa25ab6
patch 8.2.3695: confusing error for missing key
Commit: https://github.com/vim/vim/commit/5c1ec439f0a69e9aa7ece9bbb7d916f48f58be1e
Author: Bram Moolenaar <Bram@vim.org>
Date: Mon Nov 29 13:44:55 2021 +0000
patch 8.2.3695: confusing error for missing key
Problem: Confusing error for missing key.
Solution: Use the actualy key for the error. (closes https://github.com/vim/vim/issues/9241)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Mon, 29 Nov 2021 14:45:04 +0100 |
parents | 14b4c778b61e |
children | 65ab0b035dd8 |
comparison
equal
deleted
inserted
replaced
26328:4ada663d2db6 | 26329:8afd7aa25ab6 |
---|---|
4285 key = tv_get_string_chk(var1); | 4285 key = tv_get_string_chk(var1); |
4286 if (key == NULL) | 4286 if (key == NULL) |
4287 return FAIL; | 4287 return FAIL; |
4288 } | 4288 } |
4289 | 4289 |
4290 item = dict_find(rettv->vval.v_dict, key, (int)keylen); | 4290 item = dict_find(rettv->vval.v_dict, key, keylen); |
4291 | 4291 |
4292 if (item == NULL && verbose) | |
4293 semsg(_(e_dictkey), key); | |
4294 if (item == NULL) | 4292 if (item == NULL) |
4293 { | |
4294 if (verbose) | |
4295 { | |
4296 if (keylen > 0) | |
4297 key[keylen] = NUL; | |
4298 semsg(_(e_dictkey), key); | |
4299 } | |
4295 return FAIL; | 4300 return FAIL; |
4301 } | |
4296 | 4302 |
4297 copy_tv(&item->di_tv, &tmp); | 4303 copy_tv(&item->di_tv, &tmp); |
4298 clear_tv(rettv); | 4304 clear_tv(rettv); |
4299 *rettv = tmp; | 4305 *rettv = tmp; |
4300 } | 4306 } |