Patch 8.2.2946
Problem: Vim9: substitute expression cannot be a List in a :def function.
Solution: Use typval2string(). (closes #8330)
Files: src/vim9execute.c, src/testdir/test_vim9_cmd.vim
*** ../vim-8.2.2945/src/vim9execute.c 2021-06-05 20:51:34.737122348 +0200
--- src/vim9execute.c 2021-06-05 21:30:18.346986522 +0200
***************
*** 4130,4136 ****
{
typval_T *tv = STACK_TV_BOT(-1);
! res = vim_strsave(tv_get_string(tv));
--ectx->ec_stack.ga_len;
clear_tv(tv);
}
--- 4130,4136 ----
{
typval_T *tv = STACK_TV_BOT(-1);
! res = typval2string(tv, TRUE);
--ectx->ec_stack.ga_len;
clear_tv(tv);
}
*** ../vim-8.2.2945/src/testdir/test_vim9_cmd.vim 2021-06-05
17:10:46.538051161 +0200
--- src/testdir/test_vim9_cmd.vim 2021-06-05 21:35:15.202183043 +0200
***************
*** 1236,1241 ****
--- 1236,1248 ----
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()
*** ../vim-8.2.2945/src/version.c 2021-06-05 20:59:18.623771739 +0200
--- src/version.c 2021-06-05 21:31:25.022806806 +0200
***************
*** 752,753 ****
--- 752,755 ----
{ /* Add new patch number below this line */
+ /**/
+ 2946,
/**/
--
ERIC IDLE PLAYED: THE DEAD COLLECTOR, MR BINT (A VILLAGE NE'ER-DO -WELL VERY
KEEN ON BURNING WITCHES), SIR ROBIN, THE GUARD WHO DOESN'T
HICOUGH BUT TRIES TO GET THINGS STRAIGHT, CONCORDE (SIR
LAUNCELOT'S TRUSTY STEED), ROGER THE SHRUBBER (A SHRUBBER),
BROTHER MAYNARD
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202106051939.155JdRrH123966%40masaka.moolenaar.net.