summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-17 13:14:23 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-17 13:14:23 +0100
commit40c141d333292d625907f4de13766cbbc2223911 (patch)
treec8dab91ebd284ee1b168832f180ebbc882a5c22a /src/ex_docmd.c
parent0d03263fd731986c0eee1a08e0f1b19f1bc3a7ad (diff)
patch 8.2.4971: Vim9: interpolated string seen as rangev8.2.4971
Problem: Vim9: interpolated string seen as range. Solution: Recognize an interpolated string at the start of a command line. (closes #10434)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index a865f65d19..6cf77155ca 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -3551,7 +3551,8 @@ find_ex_command(
char_u *swp;
if (*eap->cmd == '&'
- || *eap->cmd == '$'
+ || (eap->cmd[0] == '$'
+ && eap->cmd[1] != '\'' && eap->cmd[1] != '"')
|| (eap->cmd[0] == '@'
&& (valid_yank_reg(eap->cmd[1], FALSE)
|| eap->cmd[1] == '@')))
@@ -3590,9 +3591,13 @@ find_ex_command(
// "'string'->func()" is an expression.
|| *eap->cmd == '\''
// '"string"->func()' is an expression.
- || (eap->cmd[0] == '0' && eap->cmd[1] == 'z')
- // '"string"->func()' is an expression.
|| *eap->cmd == '"'
+ // '$"string"->func()' is an expression.
+ // "$'string'->func()" is an expression.
+ || (eap->cmd[0] == '$'
+ && (eap->cmd[1] == '\'' || eap->cmd[1] == '"'))
+ // '0z1234->func()' is an expression.
+ || (eap->cmd[0] == '0' && eap->cmd[1] == 'z')
// "g:varname" is an expression.
|| eap->cmd[1] == ':'
)