A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/neovim/neovim/commit/39238435dbfc632356d10f287994c80142dd95bd below:

force redefinition of user commands by default (#16918) · neovim/neovim@3923843 · GitHub

File tree Expand file treeCollapse file tree 3 files changed

+14

-13

lines changed

Filter options

Expand file treeCollapse file tree 3 files changed

+14

-13

lines changed Original file line number Diff line number Diff line change

@@ -667,14 +667,17 @@ nvim_add_user_command({name}, {command}, {*opts})

667 667

{opts} Optional command attributes. See

668 668

|command-attributes| for more details. To use

669 669

boolean attributes (such as |:command-bang| or

670 -

|:command-bar|) set the value to "true". When

671 -

using a Lua function for {command} you can also

672 -

provide a "desc" key that will be displayed

673 -

when listing commands. In addition to the

674 -

string options listed in |:command-complete|,

675 -

the "complete" key also accepts a Lua function

676 -

which works like the "customlist" completion

677 -

mode |:command-completion-customlist|.

670 +

|:command-bar|) set the value to "true". In

671 +

addition to the string options listed in

672 +

|:command-complete|, the "complete" key also

673 +

accepts a Lua function which works like the

674 +

"customlist" completion mode

675 +

|:command-completion-customlist|. Additional

676 +

parameters:

677 +

• desc: (string) Used for listing the command

678 +

when a Lua function is used for {command}.

679 +

• force: (boolean, default true) Override any

680 +

previous definition.

678 681 679 682

nvim_call_atomic({calls}) *nvim_call_atomic()*

680 683

Calls many API methods atomically.

Original file line number Diff line number Diff line change

@@ -1505,7 +1505,7 @@ void add_user_command(String name, Object command, Dict(user_command) *opts, int

1505 1505

goto err;

1506 1506

}

1507 1507 1508 -

bool force = api_object_to_bool(opts->force, "force", false, err);

1508 +

bool force = api_object_to_bool(opts->force, "force", true, err);

1509 1509

if (ERROR_SET(err)) {

1510 1510

goto err;

1511 1511

}

Original file line number Diff line number Diff line change

@@ -2396,12 +2396,10 @@ Dictionary nvim_eval_statusline(String str, Dict(eval_statusline) *opts, Error *

2396 2396

/// boolean attributes (such as |:command-bang| or |:command-bar|) set the value to

2397 2397

/// "true". In addition to the string options listed in |:command-complete|, the

2398 2398

/// "complete" key also accepts a Lua function which works like the "customlist"

2399 -

/// completion mode |:command-completion-customlist|.

2400 -

///

2401 -

/// Additional parameters.

2399 +

/// completion mode |:command-completion-customlist|. Additional parameters:

2402 2400

/// - desc: (string) Used for listing the command when a Lua function is used for

2403 2401

/// {command}.

2404 -

/// - force: (boolean) Override any previous definition.

2402 +

/// - force: (boolean, default true) Override any previous definition.

2405 2403

/// @param[out] err Error details, if any.

2406 2404

void nvim_add_user_command(String name, Object command, Dict(user_command) *opts, Error *err)

2407 2405

FUNC_API_SINCE(9)

You can’t perform that action at this time.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4