aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2022-01-04 11:51:45 -0700
committerGitHub <noreply@github.com>2022-01-04 11:51:45 -0700
commit39238435dbfc632356d10f287994c80142dd95bd (patch)
treeb584be6e0ad34472e545a33ada895c7f3cc757bc /src
parent0b0c4f7dfa4a9a564cbf44262d4bea9bdefe2dc9 (diff)
downloadrneovim-39238435dbfc632356d10f287994c80142dd95bd.tar.gz
rneovim-39238435dbfc632356d10f287994c80142dd95bd.tar.bz2
rneovim-39238435dbfc632356d10f287994c80142dd95bd.zip
fix(api): force redefinition of user commands by default (#16918)
Diffstat (limited to 'src')
-rw-r--r--src/nvim/api/private/helpers.c2
-rw-r--r--src/nvim/api/vim.c6
2 files changed, 3 insertions, 5 deletions
diff --git a/src/nvim/api/private/helpers.c b/src/nvim/api/private/helpers.c
index 4884a44cea..38a82343c3 100644
--- a/src/nvim/api/private/helpers.c
+++ b/src/nvim/api/private/helpers.c
@@ -1505,7 +1505,7 @@ void add_user_command(String name, Object command, Dict(user_command) *opts, int
goto err;
}
- bool force = api_object_to_bool(opts->force, "force", false, err);
+ bool force = api_object_to_bool(opts->force, "force", true, err);
if (ERROR_SET(err)) {
goto err;
}
diff --git a/src/nvim/api/vim.c b/src/nvim/api/vim.c
index f8db4cce42..59db12f2c0 100644
--- a/src/nvim/api/vim.c
+++ b/src/nvim/api/vim.c
@@ -2396,12 +2396,10 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *
/// 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
/// "complete" key also accepts a Lua function which works like the "customlist"
-/// completion mode |:command-completion-customlist|.
-///
-/// Additional parameters.
+/// completion mode |:command-completion-customlist|. Additional parameters:
/// - desc: (string) Used for listing the command when a Lua function is used for
/// {command}.
-/// - force: (boolean) Override any previous definition.
+/// - force: (boolean, default true) Override any previous definition.
/// @param[out] err Error details, if any.
void nvim_add_user_command(String name, Object command, Dict(user_command) *opts, Error *err)
FUNC_API_SINCE(9)