From 9988d2f214963b3cac70026d6ad4bb058837afd9 Mon Sep 17 00:00:00 2001 From: Famiu Haque Date: Sun, 29 May 2022 10:42:00 +0600 Subject: feat(nvim_create_user_command): pass structured modifiers to commands Adds an `smods` key to `nvim_create_user_command` Lua command callbacks, which has command modifiers but in a structured format. This removes the need to manually parse command modifiers. It also reduces friction in using `nvim_cmd` inside a Lua command callback. --- src/nvim/api/vim.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/nvim/api') diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c index dd0b75bbfb..5c3c16d6b0 100644 --- a/src/nvim/api/vim.c +++ b/src/nvim/api/vim.c @@ -2501,6 +2501,8 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error * /// - count: (number) Any count supplied || /// - reg: (string) The optional register, if specified || /// - mods: (string) Command modifiers, if any || +/// - smods: (table) Command modifiers in a structured format. Has the same +/// structure as the "mods" key of |nvim_parse_cmd()|. /// @param opts Optional command attributes. See |command-attributes| for more details. To use /// boolean attributes (such as |:command-bang| or |:command-bar|) set the value to /// "true". In addition to the string options listed in |:command-complete|, the -- cgit