1
0
forked from aniani/vim

patch 8.2.3503: Vim9: using g:pat:cmd is confusing

Problem:    Vim9: using g:pat:cmd is confusing.
Solution:   Do not recognize g: as the :global command.  Also for s:pat:repl.
            (closes #8982)
This commit is contained in:
Bram Moolenaar
2021-10-13 15:04:34 +01:00
parent fff10d9a76
commit 7b82926892
8 changed files with 111 additions and 1 deletions

View File

@@ -3724,6 +3724,9 @@ ex_substitute(exarg_T *eap)
// don't accept alphanumeric for separator
if (check_regexp_delim(*cmd) == FAIL)
return;
if (in_vim9script() && check_global_and_subst(eap->cmd, eap->arg)
== FAIL)
return;
/*
* undocumented vi feature:
@@ -4899,6 +4902,9 @@ ex_global(exarg_T *eap)
cmd = eap->arg;
which_pat = RE_LAST; // default: use last used regexp
if (in_vim9script() && check_global_and_subst(eap->cmd, eap->arg) == FAIL)
return;
/*
* undocumented vi feature:
* "\/" and "\?": use previous search pattern.