summaryrefslogtreecommitdiff
path: root/src/vim9compile.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-05-05 15:20:03 +0100
committerBram Moolenaar <Bram@vim.org>2022-05-05 15:20:03 +0100
commit09d9421b673366e5f6e56fbf74204a1c316fdea2 (patch)
treed91eaa357364eae3ba7321ca34b4ea257f0142c3 /src/vim9compile.c
parentf3b4895f2727e3849ca10030b251cccd9d1383f3 (diff)
downloadvim-git-09d9421b673366e5f6e56fbf74204a1c316fdea2.tar.gz
patch 8.2.4871: Vim9: in :def function no error for misplaced rangev8.2.4871
Problem: Vim9: in :def function no error for using a range with a command that does not accept one. Solution: Check for the command to accept a range. (closes #10330)
Diffstat (limited to 'src/vim9compile.c')
-rw-r--r--src/vim9compile.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/vim9compile.c b/src/vim9compile.c
index 8b22a8db2..b0cf6a787 100644
--- a/src/vim9compile.c
+++ b/src/vim9compile.c
@@ -3080,6 +3080,11 @@ compile_def_function(
ea.forceit = TRUE;
p = skipwhite(p + 1);
}
+ if ((ea.argt & EX_RANGE) == 0 && ea.addr_count > 0)
+ {
+ emsg(_(e_no_range_allowed));
+ goto erret;
+ }
}
switch (ea.cmdidx)