aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/api/vimscript.c
diff options
context:
space:
mode:
authorbfredl <bjorn.linse@gmail.com>2022-05-07 09:46:06 +0200
committerGitHub <noreply@github.com>2022-05-07 09:46:06 +0200
commit6c39f9d4277778d8532bf8c308d59470a03ee2b9 (patch)
tree2b4d674d8e6924f25c1c2e61282bf742beb43351 /src/nvim/api/vimscript.c
parentcd8edb551b6eed3424c2525e50d2a5eecbfe7ccf (diff)
parent14f3383c0da1413a5ae82feb19ac89f01d4b9aad (diff)
downloadrneovim-6c39f9d4277778d8532bf8c308d59470a03ee2b9.tar.gz
rneovim-6c39f9d4277778d8532bf8c308d59470a03ee2b9.tar.bz2
rneovim-6c39f9d4277778d8532bf8c308d59470a03ee2b9.zip
Merge pull request #18457 from famiu/feat/api/nvim_parse_cmd
fix(api): make `nvim_parse_cmd` work correctly with both range and count
Diffstat (limited to 'src/nvim/api/vimscript.c')
-rw-r--r--src/nvim/api/vimscript.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/api/vimscript.c b/src/nvim/api/vimscript.c
index d3675a3c40..9396435466 100644
--- a/src/nvim/api/vimscript.c
+++ b/src/nvim/api/vimscript.c
@@ -752,7 +752,7 @@ Dictionary nvim_parse_expression(String expr, String flags, Boolean highlight, E
/// no range was specified, one element if only a single range item was
/// specified and two elements if both range items were specified.
/// - count: (number) Any |<count>| that was supplied to the command. -1 if command cannot
-/// take a count. Mutually exclusive with "range".
+/// take a count.
/// - reg: (number) The optional command |<register>|, if specified. Empty string if not
/// specified or if command cannot take a register.
/// - bang: (boolean) Whether command contains a |<bang>| (!) modifier.
@@ -853,7 +853,7 @@ Dictionary nvim_parse_cmd(String str, Dictionary opts, Error *err)
PUT(result, "cmd", CSTR_TO_OBJ((char *)get_command_name(NULL, ea.cmdidx)));
}
- if ((ea.argt & EX_RANGE) && !(ea.argt & EX_COUNT) && ea.addr_count > 0) {
+ if ((ea.argt & EX_RANGE) && ea.addr_count > 0) {
Array range = ARRAY_DICT_INIT;
if (ea.addr_count > 1) {
ADD(range, INTEGER_OBJ(ea.line1));