Mercurial > vim
comparison src/vim9execute.c @ 20170:0612c64a2b87 v8.2.0640
patch 8.2.0640: Vim9: expanding does not work
Commit: https://github.com/vim/vim/commit/cfe435d7feacf123ac060747b885f7c4328062ea
Author: Bram Moolenaar <Bram@vim.org>
Date: Sat Apr 25 20:02:55 2020 +0200
patch 8.2.0640: Vim9: expanding does not work
Problem: Vim9: expanding does not work.
Solution: Find wildcards in not compiled commands. Reorganize test files.
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sat, 25 Apr 2020 20:15:03 +0200 |
parents | fe8d0a4344df |
children | 1d84eaed0ec8 |
comparison
equal
deleted
inserted
replaced
20169:bd970e6fa5d4 | 20170:0612c64a2b87 |
---|---|
644 switch (iptr->isn_type) | 644 switch (iptr->isn_type) |
645 { | 645 { |
646 // execute Ex command line | 646 // execute Ex command line |
647 case ISN_EXEC: | 647 case ISN_EXEC: |
648 do_cmdline_cmd(iptr->isn_arg.string); | 648 do_cmdline_cmd(iptr->isn_arg.string); |
649 break; | |
650 | |
651 // execute Ex command from pieces on the stack | |
652 case ISN_EXECCONCAT: | |
653 { | |
654 int count = iptr->isn_arg.number; | |
655 int len = 0; | |
656 int pass; | |
657 int i; | |
658 char_u *cmd = NULL; | |
659 char_u *str; | |
660 | |
661 for (pass = 1; pass <= 2; ++pass) | |
662 { | |
663 for (i = 0; i < count; ++i) | |
664 { | |
665 tv = STACK_TV_BOT(i - count); | |
666 str = tv->vval.v_string; | |
667 if (str != NULL && *str != NUL) | |
668 { | |
669 if (pass == 2) | |
670 STRCPY(cmd + len, str); | |
671 len += STRLEN(str); | |
672 } | |
673 if (pass == 2) | |
674 clear_tv(tv); | |
675 } | |
676 if (pass == 1) | |
677 { | |
678 cmd = alloc(len + 1); | |
679 if (cmd == NULL) | |
680 goto failed; | |
681 len = 0; | |
682 } | |
683 } | |
684 | |
685 do_cmdline_cmd(cmd); | |
686 vim_free(cmd); | |
687 } | |
649 break; | 688 break; |
650 | 689 |
651 // execute :echo {string} ... | 690 // execute :echo {string} ... |
652 case ISN_ECHO: | 691 case ISN_ECHO: |
653 { | 692 { |
1958 | 1997 |
1959 switch (iptr->isn_type) | 1998 switch (iptr->isn_type) |
1960 { | 1999 { |
1961 case ISN_EXEC: | 2000 case ISN_EXEC: |
1962 smsg("%4d EXEC %s", current, iptr->isn_arg.string); | 2001 smsg("%4d EXEC %s", current, iptr->isn_arg.string); |
2002 break; | |
2003 case ISN_EXECCONCAT: | |
2004 smsg("%4d EXECCONCAT %lld", current, | |
2005 (long long)iptr->isn_arg.number); | |
1963 break; | 2006 break; |
1964 case ISN_ECHO: | 2007 case ISN_ECHO: |
1965 { | 2008 { |
1966 echo_T *echo = &iptr->isn_arg.echo; | 2009 echo_T *echo = &iptr->isn_arg.echo; |
1967 | 2010 |