Mercurial > vim
comparison src/vim9execute.c @ 20142:fe8d0a4344df v8.2.0626
patch 8.2.0626: Vim9: wrong syntax of function in Vim9 script
Commit: https://github.com/vim/vim/commit/f93c7fea084a99848d512ff2732041d4b41d93c8
Author: Bram Moolenaar <Bram@vim.org>
Date: Thu Apr 23 22:16:53 2020 +0200
patch 8.2.0626: Vim9: wrong syntax of function in Vim9 script
Problem: Vim9: wrong syntax of function in Vim9 script.
Solution: Give error for missing space. Implement :echomsg and :echoerr.
(closes #5670)
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Thu, 23 Apr 2020 22:30:03 +0200 |
parents | 39a18a0df429 |
children | 0612c64a2b87 |
comparison
equal
deleted
inserted
replaced
20141:3be7dea7ddcc | 20142:fe8d0a4344df |
---|---|
666 msg_clr_eos(); | 666 msg_clr_eos(); |
667 ectx.ec_stack.ga_len -= count; | 667 ectx.ec_stack.ga_len -= count; |
668 } | 668 } |
669 break; | 669 break; |
670 | 670 |
671 // execute :execute {string} ... | 671 // :execute {string} ... |
672 // :echomsg {string} ... | |
673 // :echoerr {string} ... | |
672 case ISN_EXECUTE: | 674 case ISN_EXECUTE: |
675 case ISN_ECHOMSG: | |
676 case ISN_ECHOERR: | |
673 { | 677 { |
674 int count = iptr->isn_arg.number; | 678 int count = iptr->isn_arg.number; |
675 garray_T ga; | 679 garray_T ga; |
676 char_u buf[NUMBUFLEN]; | 680 char_u buf[NUMBUFLEN]; |
677 char_u *p; | 681 char_u *p; |
703 clear_tv(tv); | 707 clear_tv(tv); |
704 } | 708 } |
705 ectx.ec_stack.ga_len -= count; | 709 ectx.ec_stack.ga_len -= count; |
706 | 710 |
707 if (!failed && ga.ga_data != NULL) | 711 if (!failed && ga.ga_data != NULL) |
708 do_cmdline_cmd((char_u *)ga.ga_data); | 712 { |
713 if (iptr->isn_type == ISN_EXECUTE) | |
714 do_cmdline_cmd((char_u *)ga.ga_data); | |
715 else | |
716 { | |
717 msg_sb_eol(); | |
718 if (iptr->isn_type == ISN_ECHOMSG) | |
719 { | |
720 msg_attr(ga.ga_data, echo_attr); | |
721 out_flush(); | |
722 } | |
723 else | |
724 { | |
725 int save_did_emsg = did_emsg; | |
726 | |
727 SOURCING_LNUM = iptr->isn_lnum; | |
728 emsg(ga.ga_data); | |
729 if (!force_abort) | |
730 // We don't want to abort following | |
731 // commands, restore did_emsg. | |
732 did_emsg = save_did_emsg; | |
733 } | |
734 } | |
735 } | |
709 ga_clear(&ga); | 736 ga_clear(&ga); |
710 } | 737 } |
711 break; | 738 break; |
712 | 739 |
713 // load local variable or argument | 740 // load local variable or argument |
1943 echo->echo_count); | 1970 echo->echo_count); |
1944 } | 1971 } |
1945 break; | 1972 break; |
1946 case ISN_EXECUTE: | 1973 case ISN_EXECUTE: |
1947 smsg("%4d EXECUTE %lld", current, | 1974 smsg("%4d EXECUTE %lld", current, |
1975 (long long)(iptr->isn_arg.number)); | |
1976 break; | |
1977 case ISN_ECHOMSG: | |
1978 smsg("%4d ECHOMSG %lld", current, | |
1979 (long long)(iptr->isn_arg.number)); | |
1980 break; | |
1981 case ISN_ECHOERR: | |
1982 smsg("%4d ECHOERR %lld", current, | |
1948 (long long)(iptr->isn_arg.number)); | 1983 (long long)(iptr->isn_arg.number)); |
1949 break; | 1984 break; |
1950 case ISN_LOAD: | 1985 case ISN_LOAD: |
1951 if (iptr->isn_arg.number < 0) | 1986 if (iptr->isn_arg.number < 0) |
1952 smsg("%4d LOAD arg[%lld]", current, | 1987 smsg("%4d LOAD arg[%lld]", current, |