diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-04-15 19:19:52 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-04-15 19:19:52 +0200 |
commit | bce51d9005dd1c5bc002acbac2e12b649abcb013 (patch) | |
tree | 046a2767183c0fd9eff9249fd44ed676db906de3 /src/vim9execute.c | |
parent | a59e031aa0bdc5cc3d1f4ed719126bf1a1b858ce (diff) |
patch 9.1.0335: String interpolation fails for List typev9.1.0335
Problem: String interpolation fails for List type
Solution: use implicit string(list) for string interpolation and :put =
(Yegappan Lakshmanan)
related: #14529
closes: #14556
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r-- | src/vim9execute.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c index b3e89396e8..5af3af68ba 100644 --- a/src/vim9execute.c +++ b/src/vim9execute.c @@ -1638,7 +1638,7 @@ store_var(char_u *name, typval_T *tv) * Return FAIL if not allowed. */ static int -do_2string(typval_T *tv, int is_2string_any, int tolerant) +do_2string(typval_T *tv, int is_2string_any, int tostring_flags) { if (tv->v_type == VAR_STRING) return OK; @@ -1657,7 +1657,7 @@ do_2string(typval_T *tv, int is_2string_any, int tolerant) case VAR_BLOB: break; case VAR_LIST: - if (tolerant) + if (tostring_flags & TOSTRING_TOLERANT) { char_u *s, *e, *p; garray_T ga; @@ -1690,6 +1690,8 @@ do_2string(typval_T *tv, int is_2string_any, int tolerant) tv->vval.v_string = ga.ga_data; return OK; } + if (tostring_flags & TOSTRING_INTERPOLATE) + break; // FALLTHROUGH default: to_string_error(tv->v_type); return FAIL; @@ -5685,7 +5687,7 @@ exec_instructions(ectx_T *ectx) SOURCING_LNUM = iptr->isn_lnum; if (do_2string(STACK_TV_BOT(iptr->isn_arg.tostring.offset), iptr->isn_type == ISN_2STRING_ANY, - iptr->isn_arg.tostring.tolerant) == FAIL) + iptr->isn_arg.tostring.flags) == FAIL) goto on_error; break; |