summaryrefslogtreecommitdiffstats
path: root/src/eval.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/eval.c')
-rw-r--r--src/eval.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/src/eval.c b/src/eval.c
index fd44db6f7e..ca5a2685fa 100644
--- a/src/eval.c
+++ b/src/eval.c
@@ -6318,36 +6318,9 @@ echo_string_core(
break;
case VAR_OBJECT:
- {
- garray_T ga;
- ga_init2(&ga, 1, 50);
- ga_concat(&ga, (char_u *)"object of ");
- object_T *obj = tv->vval.v_object;
- class_T *cl = obj == NULL ? NULL : obj->obj_class;
- ga_concat(&ga, cl == NULL ? (char_u *)"[unknown]"
- : cl->class_name);
- if (cl != NULL)
- {
- ga_concat(&ga, (char_u *)" {");
- for (int i = 0; i < cl->class_obj_member_count; ++i)
- {
- if (i > 0)
- ga_concat(&ga, (char_u *)", ");
- ocmember_T *m = &cl->class_obj_members[i];
- ga_concat(&ga, m->ocm_name);
- ga_concat(&ga, (char_u *)": ");
- char_u *tf = NULL;
- ga_concat(&ga, echo_string_core(
- (typval_T *)(obj + 1) + i,
- &tf, numbuf, copyID, echo_style,
- restore_copyID, composite_val));
- vim_free(tf);
- }
- ga_concat(&ga, (char_u *)"}");
- }
-
- *tofree = r = ga.ga_data;
- }
+ *tofree = r = object_string(tv->vval.v_object, numbuf, copyID,
+ echo_style, restore_copyID,
+ composite_val);
break;
case VAR_FLOAT: