comparison src/ex_docmd.c @ 19497:639b1d672757 v8.2.0306

patch 8.2.0306: Vim9: :substitute(pat(repl does not work in Vim9 script Commit: https://github.com/vim/vim/commit/83f37b91426b419a913aa4f42d041b2111b57864 Author: Bram Moolenaar <Bram@vim.org> Date: Sun Feb 23 14:35:01 2020 +0100 patch 8.2.0306: Vim9: :substitute(pat(repl does not work in Vim9 script Problem: Vim9: :substitute(pat(repl does not work in Vim9 script. Solution: Remember starting with a colon. (closes https://github.com/vim/vim/issues/5676)
author Bram Moolenaar <Bram@vim.org>
date Sun, 23 Feb 2020 14:45:03 +0100
parents c27837cbe922
children 3c0de44077cd
comparison
equal deleted inserted replaced
19496:53b0cee66935 19497:639b1d672757
1645 int save_msg_scroll = msg_scroll; 1645 int save_msg_scroll = msg_scroll;
1646 cmdmod_T save_cmdmod; 1646 cmdmod_T save_cmdmod;
1647 int save_reg_executing = reg_executing; 1647 int save_reg_executing = reg_executing;
1648 int ni; // set when Not Implemented 1648 int ni; // set when Not Implemented
1649 char_u *cmd; 1649 char_u *cmd;
1650 #ifdef FEAT_EVAL
1651 int starts_with_colon;
1652 #endif
1650 1653
1651 vim_memset(&ea, 0, sizeof(ea)); 1654 vim_memset(&ea, 0, sizeof(ea));
1652 ea.line1 = 1; 1655 ea.line1 = 1;
1653 ea.line2 = 1; 1656 ea.line2 = 1;
1654 #ifdef FEAT_EVAL 1657 #ifdef FEAT_EVAL
1687 ea.cmdlinep = cmdlinep; 1690 ea.cmdlinep = cmdlinep;
1688 ea.getline = fgetline; 1691 ea.getline = fgetline;
1689 ea.cookie = cookie; 1692 ea.cookie = cookie;
1690 #ifdef FEAT_EVAL 1693 #ifdef FEAT_EVAL
1691 ea.cstack = cstack; 1694 ea.cstack = cstack;
1695 starts_with_colon = *skipwhite(ea.cmd) == ':';
1692 #endif 1696 #endif
1693 if (parse_command_modifiers(&ea, &errormsg, FALSE) == FAIL) 1697 if (parse_command_modifiers(&ea, &errormsg, FALSE) == FAIL)
1694 goto doend; 1698 goto doend;
1695 1699
1696 after_modifier = ea.cmd; 1700 after_modifier = ea.cmd;
1711 ea.cmd = skip_range(ea.cmd, NULL); 1715 ea.cmd = skip_range(ea.cmd, NULL);
1712 if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL) 1716 if (*ea.cmd == '*' && vim_strchr(p_cpo, CPO_STAR) == NULL)
1713 ea.cmd = skipwhite(ea.cmd + 1); 1717 ea.cmd = skipwhite(ea.cmd + 1);
1714 1718
1715 #ifdef FEAT_EVAL 1719 #ifdef FEAT_EVAL
1716 if (current_sctx.sc_version == SCRIPT_VERSION_VIM9) 1720 if (current_sctx.sc_version == SCRIPT_VERSION_VIM9 && !starts_with_colon)
1717 p = find_ex_command(&ea, NULL, lookup_scriptvar, NULL); 1721 p = find_ex_command(&ea, NULL, lookup_scriptvar, NULL);
1718 else 1722 else
1719 #endif 1723 #endif
1720 p = find_ex_command(&ea, NULL, NULL, NULL); 1724 p = find_ex_command(&ea, NULL, NULL, NULL);
1721 1725