mirror of
https://github.com/neovim/neovim.git
synced 2025-10-04 00:46:30 +00:00
vim-patch:9.1.0329: String interpolation fails for Dict type (#28335)
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: vim/vim#14529
closes: vim/vim#14541
f01493c550
Co-authored-by: Yegappan Lakshmanan <yegappan@yahoo.com>
This commit is contained in:
@@ -969,7 +969,8 @@ int skip_expr(char **pp, evalarg_T *const evalarg)
|
||||
|
||||
/// Convert "tv" to a string.
|
||||
///
|
||||
/// @param convert when true convert a List into a sequence of lines.
|
||||
/// @param convert when true convert a List into a sequence of lines
|
||||
/// and a Dict into a textual representation of the Dict.
|
||||
///
|
||||
/// @return an allocated string.
|
||||
static char *typval2string(typval_T *tv, bool convert)
|
||||
@@ -985,6 +986,8 @@ static char *typval2string(typval_T *tv, bool convert)
|
||||
}
|
||||
ga_append(&ga, NUL);
|
||||
return (char *)ga.ga_data;
|
||||
} else if (convert && tv->v_type == VAR_DICT) {
|
||||
return encode_tv2string(tv, NULL);
|
||||
}
|
||||
return xstrdup(tv_get_string(tv));
|
||||
}
|
||||
|
Reference in New Issue
Block a user