Problem: Vim9: substitute expression cannot be a List in a :def function.
Solution: Use typval2string(). (closes #8330)
END
CheckScriptSuccess(lines)
unlet g:cond
+
+ # List results in multiple lines
+ new
+ setline(1, 'some text here')
+ s/text/\=['aaa', 'bbb', 'ccc']/
+ assert_equal(['some aaa', 'bbb', 'ccc', ' here'], getline(1, '$'))
+ bwipe!
enddef
def Test_redir_to_var()
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 2946,
/**/
2945,
/**/
{
typval_T *tv = STACK_TV_BOT(-1);
- res = vim_strsave(tv_get_string(tv));
+ res = typval2string(tv, TRUE);
--ectx->ec_stack.ga_len;
clear_tv(tv);
}