diff options
author | Björn Linse <bjorn.linse@gmail.com> | 2021-12-28 23:18:07 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-12-28 23:18:07 +0100 |
commit | 7bb593169ec8c4253d2e8a373fa2ce41cec1cc74 (patch) | |
tree | f1916b215749503bcaa0e4b934c248a75d096003 /src/nvim/ex_docmd.h | |
parent | 08616571f47cc367a5fe59b52295708b9fda3b09 (diff) | |
parent | eff11b3c3fcb9aa777deafb0a33b1523aa05b603 (diff) | |
download | rneovim-7bb593169ec8c4253d2e8a373fa2ce41cec1cc74.tar.gz rneovim-7bb593169ec8c4253d2e8a373fa2ce41cec1cc74.tar.bz2 rneovim-7bb593169ec8c4253d2e8a373fa2ce41cec1cc74.zip |
Merge pull request #16752 from gpanders/lua-user-commands
feat(api): implement nvim_{add,del}_user_command
Diffstat (limited to 'src/nvim/ex_docmd.h')
-rw-r--r-- | src/nvim/ex_docmd.h | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/src/nvim/ex_docmd.h b/src/nvim/ex_docmd.h index a302d4a3c5..abf6ec347b 100644 --- a/src/nvim/ex_docmd.h +++ b/src/nvim/ex_docmd.h @@ -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 |