From 7aedcd8febaf74403851f8482529302e3ab30922 Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Thu, 5 May 2022 01:49:29 +0600 Subject: refactor(api): make `range` in `nvim_parse_cmd` an array Changes the `range` value in `nvim_parse_cmd` into an array to describe range information more concisely. Also makes `range` and `count` be mutually exclusive by making count `-1` when command takes a range instead of a count. Additionally corrects the behavior of `count` for built-in commands by making the default count `0`. --- runtime/doc/api.txt | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'runtime') diff --git a/runtime/doc/api.txt b/runtime/doc/api.txt index d4477df803..bb7a238468 100644 --- a/runtime/doc/api.txt +++ b/runtime/doc/api.txt @@ -1775,14 +1775,15 @@ nvim_parse_cmd({str}, {opts}) *nvim_parse_cmd()* Dictionary containing command information, with these keys: • cmd: (string) Command name. - • range: (number) Number of items in the command - ||. Can be 0, 1 or 2. - • line1: (number) Starting line of command ||. -1 - if command cannot take a range. || - • line2: (number) Final line of command ||. -1 if - command cannot take a range. || + • range: (array) Command . Can have 0-2 elements + depending on how many items the range contains. Has no + elements if command doesn't accept a range or if 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 || that was supplied to the - command. -1 if command cannot take a count. + command. -1 if command cannot take a count. Mutually + exclusive with "range". • reg: (number) The optional command ||, if specified. Empty string if not specified or if command cannot take a register. -- cgit