robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

glepnirfeat(api): nvim_get_commands returns desc #396231787965d77

master
1.3 KiB35 linesraw
1#pragma once
2
3#include <stddef.h>  // IWYU pragma: keep
4#include <stdint.h>
5
6#include "nvim/api/private/defs.h"  // IWYU pragma: keep
7#include "nvim/cmdexpand_defs.h"  // IWYU pragma: keep
8#include "nvim/eval/typval_defs.h"
9#include "nvim/ex_cmds_defs.h"
10#include "nvim/garray_defs.h"
11#include "nvim/types_defs.h"
12
13typedef struct {
14  char *uc_name;             ///< The command name
15  uint32_t uc_argt;          ///< The argument type
16  char *uc_rep;              ///< The command's replacement string
17  int64_t uc_def;            ///< The default value for a range/count
18  int uc_compl;              ///< completion type
19  cmd_addr_T uc_addr_type;   ///< The command's address type
20  sctx_T uc_script_ctx;      ///< SCTX where the command was defined
21  char *uc_compl_arg;        ///< completion argument if any
22  LuaRef uc_compl_luaref;    ///< Reference to Lua completion function
23  LuaRef uc_preview_luaref;  ///< Reference to Lua preview function
24  LuaRef uc_luaref;          ///< Reference to Lua function
25  char *uc_desc;             ///< Command description
26} ucmd_T;
27
28enum { UC_BUFFER = 1, };  ///< -buffer: local to current buffer
29
30extern garray_T ucmds;
31
32#define USER_CMD(i) (&((ucmd_T *)(ucmds.ga_data))[i])
33#define USER_CMD_GA(gap, i) (&((ucmd_T *)((gap)->ga_data))[i])
34
35#include "usercmd.h.generated.h"