mirror of
https://github.com/neovim/neovim.git
synced 2025-09-29 22:48:34 +00:00
feat(api): implement nvim_{add,del}_user_command
Add support for adding and removing custom user commands with the Nvim API.
This commit is contained in:
@@ -32,6 +32,26 @@ typedef struct {
|
||||
tasave_T tabuf;
|
||||
} save_state_T;
|
||||
|
||||
typedef struct ucmd {
|
||||
char_u *uc_name; // The command name
|
||||
uint32_t uc_argt; // The argument type
|
||||
char_u *uc_rep; // The command's replacement string
|
||||
long uc_def; // The default value for a range/count
|
||||
int uc_compl; // completion type
|
||||
cmd_addr_T uc_addr_type; // The command's address type
|
||||
sctx_T uc_script_ctx; // SCTX where the command was defined
|
||||
char_u *uc_compl_arg; // completion argument if any
|
||||
LuaRef uc_compl_luaref; // Reference to Lua completion function
|
||||
LuaRef uc_luaref; // Reference to Lua function
|
||||
} ucmd_T;
|
||||
|
||||
#define UC_BUFFER 1 // -buffer: local to current buffer
|
||||
|
||||
extern garray_T ucmds;
|
||||
|
||||
#define USER_CMD(i) (&((ucmd_T *)(ucmds.ga_data))[i])
|
||||
#define USER_CMD_GA(gap, i) (&((ucmd_T *)((gap)->ga_data))[i])
|
||||
|
||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||
# include "ex_docmd.h.generated.h"
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user