summaryrefslogtreecommitdiff
path: root/src/vim9execute.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2020-04-25 20:02:55 +0200
committerBram Moolenaar <Bram@vim.org>2020-04-25 20:02:55 +0200
commitcfe435d7feacf123ac060747b885f7c4328062ea (patch)
treef97da740c86f5fb5e9c7cedeb7b48c26ebf5ac47 /src/vim9execute.c
parent49b2fb36ca94be14b98caf86420863d9bbe81a24 (diff)
downloadvim-git-cfe435d7feacf123ac060747b885f7c4328062ea.tar.gz
patch 8.2.0640: Vim9: expanding does not workv8.2.0640
Problem: Vim9: expanding does not work. Solution: Find wildcards in not compiled commands. Reorganize test files.
Diffstat (limited to 'src/vim9execute.c')
-rw-r--r--src/vim9execute.c43
1 files changed, 43 insertions, 0 deletions
diff --git a/src/vim9execute.c b/src/vim9execute.c
index 8c136967f..7172718c2 100644
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -648,6 +648,45 @@ call_def_function(
do_cmdline_cmd(iptr->isn_arg.string);
break;
+ // execute Ex command from pieces on the stack
+ case ISN_EXECCONCAT:
+ {
+ int count = iptr->isn_arg.number;
+ int len = 0;
+ int pass;
+ int i;
+ char_u *cmd = NULL;
+ char_u *str;
+
+ for (pass = 1; pass <= 2; ++pass)
+ {
+ for (i = 0; i < count; ++i)
+ {
+ tv = STACK_TV_BOT(i - count);
+ str = tv->vval.v_string;
+ if (str != NULL && *str != NUL)
+ {
+ if (pass == 2)
+ STRCPY(cmd + len, str);
+ len += STRLEN(str);
+ }
+ if (pass == 2)
+ clear_tv(tv);
+ }
+ if (pass == 1)
+ {
+ cmd = alloc(len + 1);
+ if (cmd == NULL)
+ goto failed;
+ len = 0;
+ }
+ }
+
+ do_cmdline_cmd(cmd);
+ vim_free(cmd);
+ }
+ break;
+
// execute :echo {string} ...
case ISN_ECHO:
{
@@ -1961,6 +2000,10 @@ ex_disassemble(exarg_T *eap)
case ISN_EXEC:
smsg("%4d EXEC %s", current, iptr->isn_arg.string);
break;
+ case ISN_EXECCONCAT:
+ smsg("%4d EXECCONCAT %lld", current,
+ (long long)iptr->isn_arg.number);
+ break;
case ISN_ECHO:
{
echo_T *echo = &iptr->isn_arg.echo;