Mercurial > vim
comparison src/ex_docmd.c @ 23938:2a885d095bff v8.2.2511
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Commit: https://github.com/vim/vim/commit/39f3b1411068ff187b4f9f482b2d6b2c1e7a7268
Author: Bram Moolenaar <Bram@vim.org>
Date: Sun Feb 14 12:57:36 2021 +0100
patch 8.2.2511: Vim9: cannot use Vim9 script syntax in some places
Problem: Vim9: cannot use Vim9 script syntax in some places.
Solution: Add the :vim9cmd command modifier. Incompatible: Makes ":vim9"
mean ":vim9cmd" instead of ":vim9script".
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Sun, 14 Feb 2021 13:00:04 +0100 |
parents | 00e904bdb8a5 |
children | 6e593e0aaadf |
comparison
equal
deleted
inserted
replaced
23937:0a317b1a93cd | 23938:2a885d095bff |
---|---|
1735 int ni; // set when Not Implemented | 1735 int ni; // set when Not Implemented |
1736 char_u *cmd; | 1736 char_u *cmd; |
1737 int starts_with_colon = FALSE; | 1737 int starts_with_colon = FALSE; |
1738 #ifdef FEAT_EVAL | 1738 #ifdef FEAT_EVAL |
1739 int may_have_range; | 1739 int may_have_range; |
1740 int vim9script = in_vim9script(); | 1740 int vim9script; |
1741 int did_set_expr_line = FALSE; | 1741 int did_set_expr_line = FALSE; |
1742 #endif | 1742 #endif |
1743 int sourcing = flags & DOCMD_VERBOSE; | 1743 int sourcing = flags & DOCMD_VERBOSE; |
1744 | 1744 |
1745 CLEAR_FIELD(ea); | 1745 CLEAR_FIELD(ea); |
1783 starts_with_colon = *skipwhite(ea.cmd) == ':'; | 1783 starts_with_colon = *skipwhite(ea.cmd) == ':'; |
1784 #endif | 1784 #endif |
1785 if (parse_command_modifiers(&ea, &errormsg, &cmdmod, FALSE) == FAIL) | 1785 if (parse_command_modifiers(&ea, &errormsg, &cmdmod, FALSE) == FAIL) |
1786 goto doend; | 1786 goto doend; |
1787 apply_cmdmod(&cmdmod); | 1787 apply_cmdmod(&cmdmod); |
1788 | 1788 vim9script = in_vim9script(); |
1789 after_modifier = ea.cmd; | 1789 after_modifier = ea.cmd; |
1790 | 1790 |
1791 #ifdef FEAT_EVAL | 1791 #ifdef FEAT_EVAL |
1792 ea.skip = did_emsg || got_int || did_throw || (cstack->cs_idx >= 0 | 1792 ea.skip = did_emsg || got_int || did_throw || (cstack->cs_idx >= 0 |
1793 && !(cstack->cs_flags[cstack->cs_idx] & CSF_ACTIVE)); | 1793 && !(cstack->cs_flags[cstack->cs_idx] & CSF_ACTIVE)); |
2931 case 'v': if (checkforcmd(&eap->cmd, "vertical", 4)) | 2931 case 'v': if (checkforcmd(&eap->cmd, "vertical", 4)) |
2932 { | 2932 { |
2933 cmod->cmod_split |= WSP_VERT; | 2933 cmod->cmod_split |= WSP_VERT; |
2934 continue; | 2934 continue; |
2935 } | 2935 } |
2936 if (checkforcmd(&eap->cmd, "vim9cmd", 4)) | |
2937 { | |
2938 if (ends_excmd2(p, eap->cmd)) | |
2939 { | |
2940 *errormsg = | |
2941 _(e_vim9cmd_must_be_followed_by_command); | |
2942 return FAIL; | |
2943 } | |
2944 cmod->cmod_flags |= CMOD_VIM9CMD; | |
2945 continue; | |
2946 } | |
2936 if (!checkforcmd(&p, "verbose", 4)) | 2947 if (!checkforcmd(&p, "verbose", 4)) |
2937 break; | 2948 break; |
2938 if (vim_isdigit(*eap->cmd)) | 2949 if (vim_isdigit(*eap->cmd)) |
2939 cmod->cmod_verbose = atoi((char *)eap->cmd); | 2950 cmod->cmod_verbose = atoi((char *)eap->cmd); |
2940 else | 2951 else |