diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-06 17:14:37 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-06 17:14:37 +0800 |
commit | ad7064bd83aef7caadb51c988c0dcb9054624fcf (patch) | |
tree | 87dccde4e4b661c283e9c75556a3853393ad3135 /src/nvim/usercmd.h | |
parent | 5f0fbe7c2fae82c3bf911d726af483c8a0983379 (diff) | |
download | rneovim-ad7064bd83aef7caadb51c988c0dcb9054624fcf.tar.gz rneovim-ad7064bd83aef7caadb51c988c0dcb9054624fcf.tar.bz2 rneovim-ad7064bd83aef7caadb51c988c0dcb9054624fcf.zip |
vim-patch:8.1.1210: support for user commands is spread out (#19653)
Problem: Support for user commands is spread out. No good reason to make
user commands optional.
Solution: Move user command support to usercmd.c. Always enable the
user_commands feature.
https://github.com/vim/vim/commit/ac9fb18020d7e8bf16d02d45fbb02cf47328aaf7
Diffstat (limited to 'src/nvim/usercmd.h')
-rw-r--r-- | src/nvim/usercmd.h | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/nvim/usercmd.h b/src/nvim/usercmd.h new file mode 100644 index 0000000000..637862b216 --- /dev/null +++ b/src/nvim/usercmd.h @@ -0,0 +1,30 @@ +#ifndef NVIM_USERCMD_H +#define NVIM_USERCMD_H + +#include "nvim/ex_cmds_defs.h" + +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_preview_luaref; // Reference to Lua preview 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 "usercmd.h.generated.h" +#endif +#endif // NVIM_USERCMD_H |