diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 02:10:58 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-27 02:10:58 +0000 |
commit | bee19c22d569e54513a9c591441c7f411811dc81 (patch) | |
tree | b990d2df9fddb8194bfe49e9205005a0d952bc1f /src/typval.c | |
parent | Adding upstream version 2:9.1.0199. (diff) | |
download | vim-97c93a6e6cafbb0d7a9eb94a18a7cadeb8e23a9f.tar.xz vim-97c93a6e6cafbb0d7a9eb94a18a7cadeb8e23a9f.zip |
Adding upstream version 2:9.1.0374.upstream/2%9.1.0374
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/typval.c')
-rw-r--r-- | src/typval.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/src/typval.c b/src/typval.c index 62958f6..6a73719 100644 --- a/src/typval.c +++ b/src/typval.c @@ -266,7 +266,13 @@ tv_get_bool_or_number_chk( check_typval_is_value(varp); break; case VAR_OBJECT: - emsg(_(e_using_object_as_number)); + { + class_T *cl = varp->vval.v_object->obj_class; + if (cl != NULL && IS_ENUM(cl)) + semsg(_(e_using_enum_str_as_number), cl->class_name); + else + emsg(_(e_using_object_as_number)); + } break; case VAR_VOID: emsg(_(e_cannot_use_void_value)); @@ -1139,7 +1145,13 @@ tv_get_string_buf_chk_strict(typval_T *varp, char_u *buf, int strict) check_typval_is_value(varp); break; case VAR_OBJECT: - emsg(_(e_using_object_as_string)); + { + class_T *cl = varp->vval.v_object->obj_class; + if (cl != NULL && IS_ENUM(cl)) + semsg(_(e_using_enum_str_as_string), cl->class_name); + else + emsg(_(e_using_object_as_string)); + } break; case VAR_JOB: #ifdef FEAT_JOB_CHANNEL |