From b351024daf88d8ea3b934817ba7350fb29bbf37c Mon Sep 17 00:00:00 2001 From: "Justin M. Keyes" Date: Thu, 7 May 2026 12:00:26 -0400 Subject: build(docs): lint more quasi-keysets #39654 Problem: Linter missed backtick and double-quote keynames in the quasi-keyset of the `nvim_create_user_command` docstring. Solution: Update the linter to check backtick-surrounded and quote-surrounded key names. --- src/nvim/api/command.c | 54 ++++++++++++++++++++++++-------------------------- 1 file changed, 26 insertions(+), 28 deletions(-) (limited to 'src/nvim/api/command.c') diff --git a/src/nvim/api/command.c b/src/nvim/api/command.c index 41ff02cea6..2a04d3521c 100644 --- a/src/nvim/api/command.c +++ b/src/nvim/api/command.c @@ -977,35 +977,33 @@ static void build_cmdline_str(char **cmdlinep, exarg_T *eap, CmdParseInfo *cmdin /// Hello world! /// ``` /// -/// @param name Name of the new user command. Must begin with an uppercase letter. -/// @param cmd Replacement command to execute when this user command is executed. When called -/// from Lua, the command can also be a Lua function. The function is called with a -/// single table argument that contains the following keys: -/// - args: (string) The args passed to the command, if any [] -/// - bang: (boolean) "true" if the command was executed with a ! modifier [] -/// - count: (number) Any count supplied [] -/// - fargs: (table) The args split by unescaped whitespace (when more than one -/// argument is allowed), if any [] -/// - line1: (number) The starting line of the command range [] -/// - line2: (number) The final line of the command range [] -/// - mods: (string) Command modifiers, if any [] -/// - name: (string) Command name -/// - nargs: (string) Number of arguments allowed for the command -/// - range: (number) The number of items in the command range: 0, 1, or 2 [] -/// - reg: (string) The optional register, if specified [] -/// - smods: (table) Command modifiers in a structured format. Has the same -/// structure as the "mods" key of |nvim_parse_cmd()|. -/// @param opts Optional flags +/// @param name Command name. First char must be uppercase. +/// @param cmd Command or Lua function, executed when the command is invoked. Lua function +/// receives a table with keys: +/// - args: (string) Args passed to the command, if any. [] +/// - bang: (boolean) true if the command was executed with "!". [] +/// - count: (number) Count, if any. [] +/// - fargs: (table) Args split by unescaped whitespace (when more than one arg is +/// allowed), if any. [] +/// - line1: (number) Start of the command range. [] +/// - line2: (number) End of the command range. [] +/// - mods: (string) Command modifiers (unstructured string), if any. [] +/// - name: (string) Command name. +/// - nargs: (string) Number of arguments allowed by the command. |:command-nargs| +/// - range: (number) Number of items in the command range: 0, 1, or 2. [] +/// - reg: (string) Register name, if any. [] +/// - smods: (table) Command modifiers (structured), same as "mods" in |nvim_parse_cmd()|. +/// @param opts Optional flags: +/// - `addr` |:command-addr| +/// - `complete` |:command-complete| command or function |:command-completion-customlist|. +/// - `count` |:command-count| /// - `desc` (string) Command description. -/// - `force` (boolean, default true) Override any previous definition. -/// - `complete` |:command-complete| command or function like |:command-completion-customlist|. -/// - `nargs` Number of arguments allowed for the command |:command-nargs| -/// - `preview` (function) Preview handler for 'inccommand' |:command-preview| -/// - `range` see |:command-range| -/// - `count` see |:command-count| -/// - `addr` see |:command-addr| -/// - Set boolean |command-attributes| such as |:command-bang| or |:command-bar| to -/// true (but not |:command-buffer|, use |nvim_buf_create_user_command()| instead). +/// - `force` (boolean, default true) Override the existing definition, if any. +/// - `nargs` Number of arguments allowed by the command. |:command-nargs| +/// - `preview` (function) Preview handler for 'inccommand'. |:command-preview| +/// - `range` |:command-range| +/// - boolean |command-attributes| such as |:command-bang| or |:command-bar| (but +/// not |:command-buffer|, use |nvim_buf_create_user_command()| instead). /// @param[out] err Error details, if any. void nvim_create_user_command(uint64_t channel_id, String name, -- cgit