Patch 8.2.2946

3 views
Skip to first unread message

Bram Moolenaar

unread,
Jun 5, 2021, 3:39:33 PM6/5/21
to vim...@googlegroups.com

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 -- Br...@Moolenaar.net -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
Reply all
Reply to author
Forward
0 new messages