diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2024-04-14 23:21:02 +0200 |
---|---|---|
committer | Christian Brabandt <cb@256bit.org> | 2024-04-14 23:21:02 +0200 |
commit | f01493c55062c01b1cdf9b1e946577f4d1bdddf3 (patch) | |
tree | 3f4ed5607440c2000644374866dd77850a6688ba /src/eval.c | |
parent | 0d87e3c711b46be67cf8f014cc0bca21431599c0 (diff) |
patch 9.1.0329: String interpolation fails for Dict typev9.1.0329
Problem: String interpolation fails for Dict type
Solution: Support Dict data type properly, also support :put =Dict
(without having to convert it to string() first)
(Yegappan Lakshmanan)
fixes: #14529
closes: #14541
Signed-off-by: Yegappan Lakshmanan <yegappan@yahoo.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
Diffstat (limited to 'src/eval.c')
-rw-r--r-- | src/eval.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/eval.c b/src/eval.c index e4c8baefb3..d81ef17526 100644 --- a/src/eval.c +++ b/src/eval.c @@ -575,7 +575,8 @@ skip_expr_concatenate( /* * Convert "tv" to a string. - * When "convert" is TRUE convert a List into a sequence of lines. + * When "convert" is TRUE convert a List into a sequence of lines and a Dict + * into a textual representation of the Dict. * Returns an allocated string (NULL when out of memory). */ char_u * @@ -596,6 +597,8 @@ typval2string(typval_T *tv, int convert) ga_append(&ga, NUL); retval = (char_u *)ga.ga_data; } + else if (convert && tv->v_type == VAR_DICT) + retval = dict2string(tv, get_copyID(), FALSE); else retval = vim_strsave(tv_get_string(tv)); return retval; |