mirror of
https://github.com/neovim/neovim.git
synced 2025-02-25 18:55:25 -06:00
refactor: move cmdline completion types to cmdexpand_defs.h (#25465)
This commit is contained in:
parent
9ce1623837
commit
09a17f91d0
@ -192,6 +192,7 @@
|
|||||||
# of its behavior.
|
# of its behavior.
|
||||||
{ include: [ '"nvim/arglist_defs.h"', public, '"nvim/arglist.h"', public ] },
|
{ include: [ '"nvim/arglist_defs.h"', public, '"nvim/arglist.h"', public ] },
|
||||||
{ include: [ '"nvim/buffer_defs.h"', public, '"nvim/buffer.h"', public ] },
|
{ include: [ '"nvim/buffer_defs.h"', public, '"nvim/buffer.h"', public ] },
|
||||||
|
{ include: [ '"nvim/cmdexpand_defs.h"', public, '"nvim/cmdexpand.h"', public ] },
|
||||||
{ include: [ '"nvim/eval/typval_defs.h"', public, '"nvim/eval/typval.h"', public ] },
|
{ include: [ '"nvim/eval/typval_defs.h"', public, '"nvim/eval/typval.h"', public ] },
|
||||||
{ include: [ '"nvim/ex_cmds_defs.h"', public, '"nvim/ex_cmds.h"', public ] },
|
{ include: [ '"nvim/ex_cmds_defs.h"', public, '"nvim/ex_cmds.h"', public ] },
|
||||||
{ include: [ '"nvim/ex_eval_defs.h"', public, '"nvim/ex_eval.h"', public ] },
|
{ include: [ '"nvim/ex_eval_defs.h"', public, '"nvim/ex_eval.h"', public ] },
|
||||||
|
@ -17,6 +17,7 @@
|
|||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/autocmd.h"
|
#include "nvim/autocmd.h"
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/decoration.h"
|
#include "nvim/decoration.h"
|
||||||
#include "nvim/ex_cmds.h"
|
#include "nvim/ex_cmds.h"
|
||||||
#include "nvim/ex_docmd.h"
|
#include "nvim/ex_docmd.h"
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "nvim/autocmd.h"
|
#include "nvim/autocmd.h"
|
||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/eval/window.h"
|
#include "nvim/eval/window.h"
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
#define NVIM_ARGLIST_H
|
#define NVIM_ARGLIST_H
|
||||||
|
|
||||||
#include "nvim/arglist_defs.h"
|
#include "nvim/arglist_defs.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/macros.h"
|
#include "nvim/macros.h"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef NVIM_CMDEXPAND_H
|
#ifndef NVIM_CMDEXPAND_H
|
||||||
#define NVIM_CMDEXPAND_H
|
#define NVIM_CMDEXPAND_H
|
||||||
|
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_getln.h"
|
#include "nvim/ex_getln.h"
|
||||||
#include "nvim/garray.h"
|
#include "nvim/garray.h"
|
||||||
@ -41,9 +42,6 @@ enum {
|
|||||||
BUF_DIFF_FILTER = 0x2000,
|
BUF_DIFF_FILTER = 0x2000,
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Type used by ExpandGeneric()
|
|
||||||
typedef char *(*CompleteListItemGetter)(expand_T *, int);
|
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "cmdexpand.h.generated.h"
|
# include "cmdexpand.h.generated.h"
|
||||||
#endif
|
#endif
|
||||||
|
113
src/nvim/cmdexpand_defs.h
Normal file
113
src/nvim/cmdexpand_defs.h
Normal file
@ -0,0 +1,113 @@
|
|||||||
|
#ifndef NVIM_CMDEXPAND_DEFS_H
|
||||||
|
#define NVIM_CMDEXPAND_DEFS_H
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include "nvim/eval/typval_defs.h"
|
||||||
|
#include "nvim/types.h"
|
||||||
|
|
||||||
|
typedef enum {
|
||||||
|
XP_PREFIX_NONE, ///< prefix not used
|
||||||
|
XP_PREFIX_NO, ///< "no" prefix for bool option
|
||||||
|
XP_PREFIX_INV, ///< "inv" prefix for bool option
|
||||||
|
} xp_prefix_T;
|
||||||
|
|
||||||
|
enum { EXPAND_BUF_LEN = 256, };
|
||||||
|
|
||||||
|
/// used for completion on the command line
|
||||||
|
typedef struct expand {
|
||||||
|
char *xp_pattern; ///< start of item to expand
|
||||||
|
int xp_context; ///< type of expansion
|
||||||
|
size_t xp_pattern_len; ///< bytes in xp_pattern before cursor
|
||||||
|
xp_prefix_T xp_prefix;
|
||||||
|
char *xp_arg; ///< completion function
|
||||||
|
LuaRef xp_luaref; ///< Ref to Lua completion function
|
||||||
|
sctx_T xp_script_ctx; ///< SCTX for completion function
|
||||||
|
int xp_backslash; ///< one of the XP_BS_ values
|
||||||
|
#ifndef BACKSLASH_IN_FILENAME
|
||||||
|
bool xp_shell; ///< true for a shell command, more
|
||||||
|
///< characters need to be escaped
|
||||||
|
#endif
|
||||||
|
int xp_numfiles; ///< number of files found by file name completion
|
||||||
|
int xp_col; ///< cursor position in line
|
||||||
|
int xp_selected; ///< selected index in completion
|
||||||
|
char *xp_orig; ///< originally expanded string
|
||||||
|
char **xp_files; ///< list of files
|
||||||
|
char *xp_line; ///< text being completed
|
||||||
|
char xp_buf[EXPAND_BUF_LEN]; ///< buffer for returned match
|
||||||
|
} expand_T;
|
||||||
|
|
||||||
|
/// values for xp_backslash
|
||||||
|
enum {
|
||||||
|
XP_BS_NONE = 0, ///< nothing special for backslashes
|
||||||
|
XP_BS_ONE = 1, ///< uses one backslash before a space
|
||||||
|
XP_BS_THREE = 2, ///< uses three backslashes before a space
|
||||||
|
};
|
||||||
|
|
||||||
|
/// values for xp_context when doing command line completion
|
||||||
|
enum {
|
||||||
|
EXPAND_UNSUCCESSFUL = -2,
|
||||||
|
EXPAND_OK = -1,
|
||||||
|
EXPAND_NOTHING = 0,
|
||||||
|
EXPAND_COMMANDS,
|
||||||
|
EXPAND_FILES,
|
||||||
|
EXPAND_DIRECTORIES,
|
||||||
|
EXPAND_SETTINGS,
|
||||||
|
EXPAND_BOOL_SETTINGS,
|
||||||
|
EXPAND_TAGS,
|
||||||
|
EXPAND_OLD_SETTING,
|
||||||
|
EXPAND_HELP,
|
||||||
|
EXPAND_BUFFERS,
|
||||||
|
EXPAND_EVENTS,
|
||||||
|
EXPAND_MENUS,
|
||||||
|
EXPAND_SYNTAX,
|
||||||
|
EXPAND_HIGHLIGHT,
|
||||||
|
EXPAND_AUGROUP,
|
||||||
|
EXPAND_USER_VARS,
|
||||||
|
EXPAND_MAPPINGS,
|
||||||
|
EXPAND_TAGS_LISTFILES,
|
||||||
|
EXPAND_FUNCTIONS,
|
||||||
|
EXPAND_USER_FUNC,
|
||||||
|
EXPAND_EXPRESSION,
|
||||||
|
EXPAND_MENUNAMES,
|
||||||
|
EXPAND_USER_COMMANDS,
|
||||||
|
EXPAND_USER_CMD_FLAGS,
|
||||||
|
EXPAND_USER_NARGS,
|
||||||
|
EXPAND_USER_COMPLETE,
|
||||||
|
EXPAND_ENV_VARS,
|
||||||
|
EXPAND_LANGUAGE,
|
||||||
|
EXPAND_COLORS,
|
||||||
|
EXPAND_COMPILER,
|
||||||
|
EXPAND_USER_DEFINED,
|
||||||
|
EXPAND_USER_LIST,
|
||||||
|
EXPAND_USER_LUA,
|
||||||
|
EXPAND_SHELLCMD,
|
||||||
|
EXPAND_SIGN,
|
||||||
|
EXPAND_PROFILE,
|
||||||
|
EXPAND_FILETYPE,
|
||||||
|
EXPAND_FILES_IN_PATH,
|
||||||
|
EXPAND_OWNSYNTAX,
|
||||||
|
EXPAND_LOCALES,
|
||||||
|
EXPAND_HISTORY,
|
||||||
|
EXPAND_USER,
|
||||||
|
EXPAND_SYNTIME,
|
||||||
|
EXPAND_USER_ADDR_TYPE,
|
||||||
|
EXPAND_PACKADD,
|
||||||
|
EXPAND_MESSAGES,
|
||||||
|
EXPAND_MAPCLEAR,
|
||||||
|
EXPAND_ARGLIST,
|
||||||
|
EXPAND_DIFF_BUFFERS,
|
||||||
|
EXPAND_BREAKPOINT,
|
||||||
|
EXPAND_SCRIPTNAMES,
|
||||||
|
EXPAND_RUNTIME,
|
||||||
|
EXPAND_STRING_SETTING,
|
||||||
|
EXPAND_SETTING_SUBTRACT,
|
||||||
|
EXPAND_CHECKHEALTH,
|
||||||
|
EXPAND_LUA,
|
||||||
|
};
|
||||||
|
|
||||||
|
/// Type used by ExpandGeneric()
|
||||||
|
typedef char *(*CompleteListItemGetter)(expand_T *, int);
|
||||||
|
|
||||||
|
#endif // NVIM_CMDEXPAND_DEFS_H
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cmdhist.h"
|
#include "nvim/cmdhist.h"
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/ex_cmds.h"
|
#include "nvim/ex_cmds.h"
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef NVIM_CMDHIST_H
|
#ifndef NVIM_CMDHIST_H
|
||||||
#define NVIM_CMDHIST_H
|
#define NVIM_CMDHIST_H
|
||||||
|
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/os/time.h"
|
#include "nvim/os/time.h"
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
|
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/debugger.h"
|
#include "nvim/debugger.h"
|
||||||
#include "nvim/drawscreen.h"
|
#include "nvim/drawscreen.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/channel.h"
|
#include "nvim/channel.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cmdhist.h"
|
#include "nvim/cmdhist.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/edit.h"
|
#include "nvim/edit.h"
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/channel.h"
|
#include "nvim/channel.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/event/time.h"
|
#include "nvim/event/time.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
|
@ -33,6 +33,7 @@
|
|||||||
#include "nvim/channel.h"
|
#include "nvim/channel.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cmdexpand.h"
|
#include "nvim/cmdexpand.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/context.h"
|
#include "nvim/context.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/diff.h"
|
#include "nvim/diff.h"
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "nvim/api/private/dispatch.h"
|
#include "nvim/api/private/dispatch.h"
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
|
|
||||||
|
@ -115,6 +115,19 @@ typedef enum {
|
|||||||
VAR_BLOB, ///< Blob, .v_blob is used.
|
VAR_BLOB, ///< Blob, .v_blob is used.
|
||||||
} VarType;
|
} VarType;
|
||||||
|
|
||||||
|
/// Type values for type().
|
||||||
|
enum {
|
||||||
|
VAR_TYPE_NUMBER = 0,
|
||||||
|
VAR_TYPE_STRING = 1,
|
||||||
|
VAR_TYPE_FUNC = 2,
|
||||||
|
VAR_TYPE_LIST = 3,
|
||||||
|
VAR_TYPE_DICT = 4,
|
||||||
|
VAR_TYPE_FLOAT = 5,
|
||||||
|
VAR_TYPE_BOOL = 6,
|
||||||
|
VAR_TYPE_SPECIAL = 7,
|
||||||
|
VAR_TYPE_BLOB = 10,
|
||||||
|
};
|
||||||
|
|
||||||
/// Structure that holds an internal variable value
|
/// Structure that holds an internal variable value
|
||||||
typedef struct {
|
typedef struct {
|
||||||
VarType v_type; ///< Variable type.
|
VarType v_type; ///< Variable type.
|
||||||
|
@ -14,6 +14,7 @@
|
|||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/autocmd.h"
|
#include "nvim/autocmd.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/debugger.h"
|
#include "nvim/debugger.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/encode.h"
|
#include "nvim/eval/encode.h"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
|
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
|
@ -27,6 +27,7 @@
|
|||||||
#include "nvim/change.h"
|
#include "nvim/change.h"
|
||||||
#include "nvim/channel.h"
|
#include "nvim/channel.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cmdhist.h"
|
#include "nvim/cmdhist.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/decoration.h"
|
#include "nvim/decoration.h"
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
|
#include "nvim/ex_eval_defs.h"
|
||||||
#include "nvim/normal.h"
|
#include "nvim/normal.h"
|
||||||
#include "nvim/pos.h"
|
#include "nvim/pos.h"
|
||||||
#include "nvim/regexp_defs.h"
|
#include "nvim/regexp_defs.h"
|
||||||
@ -69,20 +70,20 @@
|
|||||||
#define EX_FILE1 (EX_FILES | EX_NOSPC) // 1 file, defaults to current file
|
#define EX_FILE1 (EX_FILES | EX_NOSPC) // 1 file, defaults to current file
|
||||||
#define EX_WORD1 (EX_EXTRA | EX_NOSPC) // one extra word allowed
|
#define EX_WORD1 (EX_EXTRA | EX_NOSPC) // one extra word allowed
|
||||||
|
|
||||||
// values for cmd_addr_type
|
/// values for cmd_addr_type
|
||||||
typedef enum {
|
typedef enum {
|
||||||
ADDR_LINES, // buffer line numbers
|
ADDR_LINES, ///< buffer line numbers
|
||||||
ADDR_WINDOWS, // window number
|
ADDR_WINDOWS, ///< window number
|
||||||
ADDR_ARGUMENTS, // argument number
|
ADDR_ARGUMENTS, ///< argument number
|
||||||
ADDR_LOADED_BUFFERS, // buffer number of loaded buffer
|
ADDR_LOADED_BUFFERS, ///< buffer number of loaded buffer
|
||||||
ADDR_BUFFERS, // buffer number
|
ADDR_BUFFERS, ///< buffer number
|
||||||
ADDR_TABS, // tab page number
|
ADDR_TABS, ///< tab page number
|
||||||
ADDR_TABS_RELATIVE, // Tab page that only relative
|
ADDR_TABS_RELATIVE, ///< Tab page that only relative
|
||||||
ADDR_QUICKFIX_VALID, // quickfix list valid entry number
|
ADDR_QUICKFIX_VALID, ///< quickfix list valid entry number
|
||||||
ADDR_QUICKFIX, // quickfix list entry number
|
ADDR_QUICKFIX, ///< quickfix list entry number
|
||||||
ADDR_UNSIGNED, // positive count or zero, defaults to 1
|
ADDR_UNSIGNED, ///< positive count or zero, defaults to 1
|
||||||
ADDR_OTHER, // something else, use line number for '$', '%', etc.
|
ADDR_OTHER, ///< something else, use line number for '$', '%', etc.
|
||||||
ADDR_NONE, // no range used
|
ADDR_NONE, ///< no range used
|
||||||
} cmd_addr_T;
|
} cmd_addr_T;
|
||||||
|
|
||||||
typedef struct exarg exarg_T;
|
typedef struct exarg exarg_T;
|
||||||
@ -135,47 +136,6 @@ typedef struct cmdname {
|
|||||||
cmd_addr_T cmd_addr_type; ///< Flag for address type.
|
cmd_addr_T cmd_addr_type; ///< Flag for address type.
|
||||||
} CommandDefinition;
|
} CommandDefinition;
|
||||||
|
|
||||||
// A list used for saving values of "emsg_silent". Used by ex_try() to save the
|
|
||||||
// value of "emsg_silent" if it was non-zero. When this is done, the CSF_SILENT
|
|
||||||
// flag below is set.
|
|
||||||
typedef struct eslist_elem eslist_T;
|
|
||||||
struct eslist_elem {
|
|
||||||
int saved_emsg_silent; // saved value of "emsg_silent"
|
|
||||||
eslist_T *next; // next element on the list
|
|
||||||
};
|
|
||||||
|
|
||||||
// For conditional commands a stack is kept of nested conditionals.
|
|
||||||
// When cs_idx < 0, there is no conditional command.
|
|
||||||
enum {
|
|
||||||
CSTACK_LEN = 50,
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct {
|
|
||||||
int cs_flags[CSTACK_LEN]; // CSF_ flags
|
|
||||||
char cs_pending[CSTACK_LEN]; // CSTP_: what's pending in ":finally"
|
|
||||||
union {
|
|
||||||
void *csp_rv[CSTACK_LEN]; // return typeval for pending return
|
|
||||||
void *csp_ex[CSTACK_LEN]; // exception for pending throw
|
|
||||||
} cs_pend;
|
|
||||||
void *cs_forinfo[CSTACK_LEN]; // info used by ":for"
|
|
||||||
int cs_line[CSTACK_LEN]; // line nr of ":while"/":for" line
|
|
||||||
int cs_idx; // current entry, or -1 if none
|
|
||||||
int cs_looplevel; // nr of nested ":while"s and ":for"s
|
|
||||||
int cs_trylevel; // nr of nested ":try"s
|
|
||||||
eslist_T *cs_emsg_silent_list; // saved values of "emsg_silent"
|
|
||||||
int cs_lflags; // loop flags: CSL_ flags
|
|
||||||
} cstack_T;
|
|
||||||
#define cs_rettv cs_pend.csp_rv
|
|
||||||
#define cs_exception cs_pend.csp_ex
|
|
||||||
|
|
||||||
// Flags for the cs_lflags item in cstack_T.
|
|
||||||
enum {
|
|
||||||
CSL_HAD_LOOP = 1, // just found ":while" or ":for"
|
|
||||||
CSL_HAD_ENDLOOP = 2, // just found ":endwhile" or ":endfor"
|
|
||||||
CSL_HAD_CONT = 4, // just found ":continue"
|
|
||||||
CSL_HAD_FINA = 8, // just found ":finally"
|
|
||||||
};
|
|
||||||
|
|
||||||
/// Arguments used for Ex commands.
|
/// Arguments used for Ex commands.
|
||||||
struct exarg {
|
struct exarg {
|
||||||
char *arg; ///< argument of the command
|
char *arg; ///< argument of the command
|
||||||
@ -222,41 +182,6 @@ struct exarg {
|
|||||||
#define EXFLAG_NR 0x02 // '#': number
|
#define EXFLAG_NR 0x02 // '#': number
|
||||||
#define EXFLAG_PRINT 0x04 // 'p': print
|
#define EXFLAG_PRINT 0x04 // 'p': print
|
||||||
|
|
||||||
typedef enum {
|
|
||||||
XP_PREFIX_NONE, ///< prefix not used
|
|
||||||
XP_PREFIX_NO, ///< "no" prefix for bool option
|
|
||||||
XP_PREFIX_INV, ///< "inv" prefix for bool option
|
|
||||||
} xp_prefix_T;
|
|
||||||
|
|
||||||
// used for completion on the command line
|
|
||||||
struct expand {
|
|
||||||
char *xp_pattern; // start of item to expand
|
|
||||||
int xp_context; // type of expansion
|
|
||||||
size_t xp_pattern_len; // bytes in xp_pattern before cursor
|
|
||||||
xp_prefix_T xp_prefix;
|
|
||||||
char *xp_arg; // completion function
|
|
||||||
LuaRef xp_luaref; // Ref to Lua completion function
|
|
||||||
sctx_T xp_script_ctx; // SCTX for completion function
|
|
||||||
int xp_backslash; // one of the XP_BS_ values
|
|
||||||
#ifndef BACKSLASH_IN_FILENAME
|
|
||||||
int xp_shell; // true for a shell command, more
|
|
||||||
// characters need to be escaped
|
|
||||||
#endif
|
|
||||||
int xp_numfiles; // number of files found by file name completion
|
|
||||||
int xp_col; // cursor position in line
|
|
||||||
int xp_selected; // selected index in completion
|
|
||||||
char *xp_orig; // originally expanded string
|
|
||||||
char **xp_files; // list of files
|
|
||||||
char *xp_line; // text being completed
|
|
||||||
#define EXPAND_BUF_LEN 256
|
|
||||||
char xp_buf[EXPAND_BUF_LEN]; // buffer for returned match
|
|
||||||
};
|
|
||||||
|
|
||||||
// values for xp_backslash
|
|
||||||
#define XP_BS_NONE 0 // nothing special for backslashes
|
|
||||||
#define XP_BS_ONE 1 // uses one backslash before a space
|
|
||||||
#define XP_BS_THREE 2 // uses three backslashes before a space
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
CMOD_SANDBOX = 0x0001, ///< ":sandbox"
|
CMOD_SANDBOX = 0x0001, ///< ":sandbox"
|
||||||
CMOD_SILENT = 0x0002, ///< ":silent"
|
CMOD_SILENT = 0x0002, ///< ":silent"
|
||||||
|
@ -22,6 +22,7 @@
|
|||||||
#include "nvim/change.h"
|
#include "nvim/change.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cmdexpand.h"
|
#include "nvim/cmdexpand.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/debugger.h"
|
#include "nvim/debugger.h"
|
||||||
#include "nvim/digraph.h"
|
#include "nvim/digraph.h"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/getchar_defs.h"
|
#include "nvim/getchar_defs.h"
|
||||||
#include "nvim/globals.h"
|
#include "nvim/globals.h"
|
||||||
|
@ -5,6 +5,37 @@
|
|||||||
|
|
||||||
#include "nvim/pos.h"
|
#include "nvim/pos.h"
|
||||||
|
|
||||||
|
/// A list used for saving values of "emsg_silent". Used by ex_try() to save the
|
||||||
|
/// value of "emsg_silent" if it was non-zero. When this is done, the CSF_SILENT
|
||||||
|
/// flag below is set.
|
||||||
|
typedef struct eslist_elem eslist_T;
|
||||||
|
struct eslist_elem {
|
||||||
|
int saved_emsg_silent; ///< saved value of "emsg_silent"
|
||||||
|
eslist_T *next; ///< next element on the list
|
||||||
|
};
|
||||||
|
|
||||||
|
/// For conditional commands a stack is kept of nested conditionals.
|
||||||
|
/// When cs_idx < 0, there is no conditional command.
|
||||||
|
enum { CSTACK_LEN = 50, };
|
||||||
|
|
||||||
|
typedef struct {
|
||||||
|
int cs_flags[CSTACK_LEN]; ///< CSF_ flags
|
||||||
|
char cs_pending[CSTACK_LEN]; ///< CSTP_: what's pending in ":finally"
|
||||||
|
union {
|
||||||
|
void *csp_rv[CSTACK_LEN]; ///< return typeval for pending return
|
||||||
|
void *csp_ex[CSTACK_LEN]; ///< exception for pending throw
|
||||||
|
} cs_pend;
|
||||||
|
void *cs_forinfo[CSTACK_LEN]; ///< info used by ":for"
|
||||||
|
int cs_line[CSTACK_LEN]; ///< line nr of ":while"/":for" line
|
||||||
|
int cs_idx; ///< current entry, or -1 if none
|
||||||
|
int cs_looplevel; ///< nr of nested ":while"s and ":for"s
|
||||||
|
int cs_trylevel; ///< nr of nested ":try"s
|
||||||
|
eslist_T *cs_emsg_silent_list; ///< saved values of "emsg_silent"
|
||||||
|
int cs_lflags; ///< loop flags: CSL_ flags
|
||||||
|
} cstack_T;
|
||||||
|
#define cs_rettv cs_pend.csp_rv
|
||||||
|
#define cs_exception cs_pend.csp_ex
|
||||||
|
|
||||||
/// There is no CSF_IF, the lack of CSF_WHILE, CSF_FOR and CSF_TRY means ":if"
|
/// There is no CSF_IF, the lack of CSF_WHILE, CSF_FOR and CSF_TRY means ":if"
|
||||||
/// was used.
|
/// was used.
|
||||||
enum {
|
enum {
|
||||||
@ -37,6 +68,14 @@ enum {
|
|||||||
CSTP_FINISH = 32, ///< ":finish" is pending
|
CSTP_FINISH = 32, ///< ":finish" is pending
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/// Flags for the cs_lflags item in cstack_T.
|
||||||
|
enum {
|
||||||
|
CSL_HAD_LOOP = 1, ///< just found ":while" or ":for"
|
||||||
|
CSL_HAD_ENDLOOP = 2, ///< just found ":endwhile" or ":endfor"
|
||||||
|
CSL_HAD_CONT = 4, ///< just found ":continue"
|
||||||
|
CSL_HAD_FINA = 8, ///< just found ":finally"
|
||||||
|
};
|
||||||
|
|
||||||
/// A list of error messages that can be converted to an exception. "throw_msg"
|
/// A list of error messages that can be converted to an exception. "throw_msg"
|
||||||
/// is only set in the first element of the list. Usually, it points to the
|
/// is only set in the first element of the list. Usually, it points to the
|
||||||
/// original message stored in that element, but sometimes it points to a later
|
/// original message stored in that element, but sometimes it points to a later
|
||||||
|
@ -71,6 +71,7 @@
|
|||||||
#include "nvim/search.h"
|
#include "nvim/search.h"
|
||||||
#include "nvim/state.h"
|
#include "nvim/state.h"
|
||||||
#include "nvim/strings.h"
|
#include "nvim/strings.h"
|
||||||
|
#include "nvim/types.h"
|
||||||
#include "nvim/ui.h"
|
#include "nvim/ui.h"
|
||||||
#include "nvim/undo.h"
|
#include "nvim/undo.h"
|
||||||
#include "nvim/usercmd.h"
|
#include "nvim/usercmd.h"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "klib/kvec.h"
|
#include "klib/kvec.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/option_defs.h"
|
#include "nvim/option_defs.h"
|
||||||
|
@ -28,7 +28,7 @@
|
|||||||
#include "nvim/drawscreen.h"
|
#include "nvim/drawscreen.h"
|
||||||
#include "nvim/edit.h"
|
#include "nvim/edit.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/ex_cmds.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/ex_eval.h"
|
#include "nvim/ex_eval.h"
|
||||||
#include "nvim/fileio.h"
|
#include "nvim/fileio.h"
|
||||||
#include "nvim/fold.h"
|
#include "nvim/fold.h"
|
||||||
|
@ -3,7 +3,10 @@
|
|||||||
|
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/garray.h"
|
#include "nvim/garray.h"
|
||||||
|
#include "nvim/globals.h"
|
||||||
|
#include "nvim/os/fs_defs.h"
|
||||||
#include "nvim/os/os.h"
|
#include "nvim/os/os.h"
|
||||||
|
|
||||||
// Values for readfile() flags
|
// Values for readfile() flags
|
||||||
|
@ -18,13 +18,13 @@
|
|||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/autocmd.h"
|
#include "nvim/autocmd.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cursor_shape.h"
|
#include "nvim/cursor_shape.h"
|
||||||
#include "nvim/decoration_provider.h"
|
#include "nvim/decoration_provider.h"
|
||||||
#include "nvim/drawscreen.h"
|
#include "nvim/drawscreen.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/eval/vars.h"
|
#include "nvim/eval/vars.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
|
||||||
#include "nvim/ex_docmd.h"
|
#include "nvim/ex_docmd.h"
|
||||||
#include "nvim/garray.h"
|
#include "nvim/garray.h"
|
||||||
#include "nvim/gettext.h"
|
#include "nvim/gettext.h"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include "nvim/api/keysets.h"
|
#include "nvim/api/keysets.h"
|
||||||
#include "nvim/api/private/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/highlight_defs.h"
|
#include "nvim/highlight_defs.h"
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
|
|
||||||
|
@ -24,7 +24,6 @@
|
|||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/eval/userfunc.h"
|
#include "nvim/eval/userfunc.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
|
||||||
#include "nvim/ex_docmd.h"
|
#include "nvim/ex_docmd.h"
|
||||||
#include "nvim/ex_eval.h"
|
#include "nvim/ex_eval.h"
|
||||||
#include "nvim/ex_getln.h"
|
#include "nvim/ex_getln.h"
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "nvim/api/private/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/change.h"
|
#include "nvim/change.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/drawscreen.h"
|
#include "nvim/drawscreen.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
|
@ -8,6 +8,7 @@
|
|||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/api/private/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
#include "nvim/assert.h"
|
#include "nvim/assert.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/func_attr.h"
|
||||||
|
@ -21,6 +21,7 @@
|
|||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cmdexpand.h"
|
#include "nvim/cmdexpand.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
|
@ -7,6 +7,7 @@
|
|||||||
|
|
||||||
#include "nvim/api/keysets.h"
|
#include "nvim/api/keysets.h"
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/mapping_defs.h"
|
#include "nvim/mapping_defs.h"
|
||||||
|
@ -43,6 +43,7 @@
|
|||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/drawscreen.h"
|
#include "nvim/drawscreen.h"
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/func_attr.h"
|
#include "nvim/func_attr.h"
|
||||||
#include "nvim/mbyte_defs.h"
|
#include "nvim/mbyte_defs.h"
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/autocmd.h"
|
#include "nvim/autocmd.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/menu_defs.h"
|
#include "nvim/menu_defs.h"
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#include "nvim/change.h"
|
#include "nvim/change.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cmdexpand.h"
|
#include "nvim/cmdexpand.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cursor_shape.h"
|
#include "nvim/cursor_shape.h"
|
||||||
#include "nvim/decoration_provider.h"
|
#include "nvim/decoration_provider.h"
|
||||||
#include "nvim/diff.h"
|
#include "nvim/diff.h"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include "nvim/api/private/helpers.h"
|
#include "nvim/api/private/helpers.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/option_defs.h"
|
#include "nvim/option_defs.h"
|
||||||
|
@ -1,8 +1,11 @@
|
|||||||
#ifndef NVIM_OPTION_DEFS_H
|
#ifndef NVIM_OPTION_DEFS_H
|
||||||
#define NVIM_OPTION_DEFS_H
|
#define NVIM_OPTION_DEFS_H
|
||||||
|
|
||||||
|
#include <stdbool.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
|
||||||
#include "nvim/api/private/defs.h"
|
#include "nvim/api/private/defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/regexp_defs.h"
|
#include "nvim/regexp_defs.h"
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
|
|
||||||
|
@ -12,6 +12,7 @@
|
|||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cmdexpand.h"
|
#include "nvim/cmdexpand.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/cursor_shape.h"
|
#include "nvim/cursor_shape.h"
|
||||||
#include "nvim/diff.h"
|
#include "nvim/diff.h"
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#define NVIM_OPTIONSTR_H
|
#define NVIM_OPTIONSTR_H
|
||||||
|
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/cmdexpand.h"
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/option_defs.h"
|
#include "nvim/option_defs.h"
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
|
@ -17,7 +17,6 @@
|
|||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cmdexpand.h"
|
#include "nvim/cmdexpand.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
|
||||||
#include "nvim/gettext.h"
|
#include "nvim/gettext.h"
|
||||||
#include "nvim/globals.h"
|
#include "nvim/globals.h"
|
||||||
#include "nvim/log.h"
|
#include "nvim/log.h"
|
||||||
@ -29,7 +28,6 @@
|
|||||||
#include "nvim/os/os.h"
|
#include "nvim/os/os.h"
|
||||||
#include "nvim/path.h"
|
#include "nvim/path.h"
|
||||||
#include "nvim/strings.h"
|
#include "nvim/strings.h"
|
||||||
#include "nvim/types.h"
|
|
||||||
#include "nvim/version.h"
|
#include "nvim/version.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
# define Boolean CFBoolean // Avoid conflict with API's Boolean
|
# define Boolean CFBoolean // Avoid conflict with API's Boolean
|
||||||
# define FileInfo CSFileInfo // Avoid conflict with API's Fileinfo
|
# define FileInfo CSFileInfo // Avoid conflict with API's Fileinfo
|
||||||
# include <CoreServices/CoreServices.h>
|
# include <CoreServices/CoreServices.h>
|
||||||
|
|
||||||
# undef Boolean
|
# undef Boolean
|
||||||
# undef FileInfo
|
# undef FileInfo
|
||||||
#endif
|
#endif
|
||||||
@ -17,6 +18,7 @@
|
|||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/garray.h"
|
#include "nvim/garray.h"
|
||||||
@ -30,7 +32,6 @@
|
|||||||
#include "nvim/os/shell.h"
|
#include "nvim/os/shell.h"
|
||||||
#include "nvim/path.h"
|
#include "nvim/path.h"
|
||||||
#include "nvim/profile.h"
|
#include "nvim/profile.h"
|
||||||
#include "nvim/types.h"
|
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
#ifndef NVIM_OS_LANG_H
|
#ifndef NVIM_OS_LANG_H
|
||||||
#define NVIM_OS_LANG_H
|
#define NVIM_OS_LANG_H
|
||||||
|
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
|
|
||||||
|
@ -4,9 +4,12 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <uv.h>
|
#include <uv.h>
|
||||||
|
|
||||||
|
#include "nvim/buffer_defs.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
|
#include "nvim/garray.h"
|
||||||
#include "nvim/os/fs_defs.h"
|
#include "nvim/os/fs_defs.h"
|
||||||
#include "nvim/os/stdpaths_defs.h"
|
#include "nvim/os/stdpaths_defs.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/types.h"
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "os/env.h.generated.h"
|
# include "os/env.h.generated.h"
|
||||||
|
@ -10,10 +10,10 @@
|
|||||||
|
|
||||||
#include "auto/config.h"
|
#include "auto/config.h"
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/garray.h"
|
#include "nvim/garray.h"
|
||||||
#include "nvim/memory.h"
|
#include "nvim/memory.h"
|
||||||
#include "nvim/os/os.h"
|
#include "nvim/os/os.h"
|
||||||
#include "nvim/types.h"
|
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#ifdef HAVE_PWD_FUNCS
|
#ifdef HAVE_PWD_FUNCS
|
||||||
# include <pwd.h>
|
# include <pwd.h>
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/debugger.h"
|
#include "nvim/debugger.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
@ -30,7 +31,6 @@
|
|||||||
#include "nvim/profile.h"
|
#include "nvim/profile.h"
|
||||||
#include "nvim/runtime.h"
|
#include "nvim/runtime.h"
|
||||||
#include "nvim/types.h"
|
#include "nvim/types.h"
|
||||||
#include "nvim/vim.h"
|
|
||||||
|
|
||||||
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
#ifdef INCLUDE_GENERATED_DECLARATIONS
|
||||||
# include "profile.c.generated.h"
|
# include "profile.c.generated.h"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/runtime.h"
|
#include "nvim/runtime.h"
|
||||||
|
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
#include "nvim/autocmd.h"
|
#include "nvim/autocmd.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
#include "nvim/cmdexpand.h"
|
#include "nvim/cmdexpand.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/debugger.h"
|
#include "nvim/debugger.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/typval.h"
|
#include "nvim/eval/typval.h"
|
||||||
|
@ -5,6 +5,7 @@
|
|||||||
|
|
||||||
#include "klib/kvec.h"
|
#include "klib/kvec.h"
|
||||||
#include "nvim/autocmd.h"
|
#include "nvim/autocmd.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/ex_eval_defs.h"
|
#include "nvim/ex_eval_defs.h"
|
||||||
|
@ -1564,15 +1564,14 @@ static ShaDaWriteResult shada_pack_entry(msgpack_packer *const packer, ShadaEntr
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case kSDItemVariable: {
|
case kSDItemVariable: {
|
||||||
if (entry.data.global_var.value.v_type == VAR_TYPE_BLOB) {
|
if (entry.data.global_var.value.v_type == VAR_BLOB) {
|
||||||
// Strings and Blobs both pack as msgpack BINs; differentiate them by
|
// Strings and Blobs both pack as msgpack BINs; differentiate them by
|
||||||
// storing an additional VAR_TYPE_BLOB element alongside Blobs
|
// storing an additional VAR_TYPE_BLOB element alongside Blobs
|
||||||
list_T *const list = tv_list_alloc(1);
|
list_T *const list = tv_list_alloc(1);
|
||||||
tv_list_append_number(list, VAR_TYPE_BLOB);
|
tv_list_append_number(list, VAR_TYPE_BLOB);
|
||||||
entry.data.global_var.additional_elements = list;
|
entry.data.global_var.additional_elements = list;
|
||||||
}
|
}
|
||||||
const size_t arr_size = 2 + (size_t)(
|
const size_t arr_size = 2 + (size_t)(tv_list_len(entry.data.global_var.additional_elements));
|
||||||
tv_list_len(entry.data.global_var.additional_elements));
|
|
||||||
msgpack_pack_array(spacker, arr_size);
|
msgpack_pack_array(spacker, arr_size);
|
||||||
const String varname = cstr_as_string(entry.data.global_var.name);
|
const String varname = cstr_as_string(entry.data.global_var.name);
|
||||||
PACK_BIN(varname);
|
PACK_BIN(varname);
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/cursor.h"
|
#include "nvim/cursor.h"
|
||||||
#include "nvim/drawscreen.h"
|
#include "nvim/drawscreen.h"
|
||||||
#include "nvim/edit.h"
|
#include "nvim/edit.h"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/sign_defs.h"
|
#include "nvim/sign_defs.h"
|
||||||
|
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
#include "nvim/buffer.h"
|
#include "nvim/buffer.h"
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/drawscreen.h"
|
#include "nvim/drawscreen.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
|
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/globals.h"
|
#include "nvim/globals.h"
|
||||||
#include "nvim/macros.h"
|
#include "nvim/macros.h"
|
||||||
|
@ -56,7 +56,6 @@
|
|||||||
#include "nvim/search.h"
|
#include "nvim/search.h"
|
||||||
#include "nvim/strings.h"
|
#include "nvim/strings.h"
|
||||||
#include "nvim/tag.h"
|
#include "nvim/tag.h"
|
||||||
#include "nvim/types.h"
|
|
||||||
#include "nvim/ui.h"
|
#include "nvim/ui.h"
|
||||||
#include "nvim/vim.h"
|
#include "nvim/vim.h"
|
||||||
#include "nvim/window.h"
|
#include "nvim/window.h"
|
||||||
|
@ -31,8 +31,6 @@ typedef union {
|
|||||||
|
|
||||||
typedef handle_T NS;
|
typedef handle_T NS;
|
||||||
|
|
||||||
typedef struct expand expand_T;
|
|
||||||
|
|
||||||
typedef uint64_t proftime_T;
|
typedef uint64_t proftime_T;
|
||||||
|
|
||||||
typedef enum {
|
typedef enum {
|
||||||
|
@ -16,6 +16,7 @@
|
|||||||
#include "nvim/ascii.h"
|
#include "nvim/ascii.h"
|
||||||
#include "nvim/buffer_defs.h"
|
#include "nvim/buffer_defs.h"
|
||||||
#include "nvim/charset.h"
|
#include "nvim/charset.h"
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval.h"
|
#include "nvim/eval.h"
|
||||||
#include "nvim/ex_docmd.h"
|
#include "nvim/ex_docmd.h"
|
||||||
#include "nvim/garray.h"
|
#include "nvim/garray.h"
|
||||||
|
@ -3,6 +3,7 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "nvim/cmdexpand_defs.h"
|
||||||
#include "nvim/eval/typval_defs.h"
|
#include "nvim/eval/typval_defs.h"
|
||||||
#include "nvim/ex_cmds_defs.h"
|
#include "nvim/ex_cmds_defs.h"
|
||||||
#include "nvim/garray.h"
|
#include "nvim/garray.h"
|
||||||
|
@ -96,85 +96,10 @@ typedef enum {
|
|||||||
#define FAIL 0
|
#define FAIL 0
|
||||||
#define NOTDONE 2 // not OK or FAIL but skipped
|
#define NOTDONE 2 // not OK or FAIL but skipped
|
||||||
|
|
||||||
// Type values for type().
|
|
||||||
#define VAR_TYPE_NUMBER 0
|
|
||||||
#define VAR_TYPE_STRING 1
|
|
||||||
#define VAR_TYPE_FUNC 2
|
|
||||||
#define VAR_TYPE_LIST 3
|
|
||||||
#define VAR_TYPE_DICT 4
|
|
||||||
#define VAR_TYPE_FLOAT 5
|
|
||||||
#define VAR_TYPE_BOOL 6
|
|
||||||
#define VAR_TYPE_SPECIAL 7
|
|
||||||
#define VAR_TYPE_BLOB 10
|
|
||||||
|
|
||||||
// values for xp_context when doing command line completion
|
|
||||||
|
|
||||||
enum {
|
|
||||||
EXPAND_UNSUCCESSFUL = -2,
|
|
||||||
EXPAND_OK = -1,
|
|
||||||
EXPAND_NOTHING = 0,
|
|
||||||
EXPAND_COMMANDS,
|
|
||||||
EXPAND_FILES,
|
|
||||||
EXPAND_DIRECTORIES,
|
|
||||||
EXPAND_SETTINGS,
|
|
||||||
EXPAND_BOOL_SETTINGS,
|
|
||||||
EXPAND_TAGS,
|
|
||||||
EXPAND_OLD_SETTING,
|
|
||||||
EXPAND_HELP,
|
|
||||||
EXPAND_BUFFERS,
|
|
||||||
EXPAND_EVENTS,
|
|
||||||
EXPAND_MENUS,
|
|
||||||
EXPAND_SYNTAX,
|
|
||||||
EXPAND_HIGHLIGHT,
|
|
||||||
EXPAND_AUGROUP,
|
|
||||||
EXPAND_USER_VARS,
|
|
||||||
EXPAND_MAPPINGS,
|
|
||||||
EXPAND_TAGS_LISTFILES,
|
|
||||||
EXPAND_FUNCTIONS,
|
|
||||||
EXPAND_USER_FUNC,
|
|
||||||
EXPAND_EXPRESSION,
|
|
||||||
EXPAND_MENUNAMES,
|
|
||||||
EXPAND_USER_COMMANDS,
|
|
||||||
EXPAND_USER_CMD_FLAGS,
|
|
||||||
EXPAND_USER_NARGS,
|
|
||||||
EXPAND_USER_COMPLETE,
|
|
||||||
EXPAND_ENV_VARS,
|
|
||||||
EXPAND_LANGUAGE,
|
|
||||||
EXPAND_COLORS,
|
|
||||||
EXPAND_COMPILER,
|
|
||||||
EXPAND_USER_DEFINED,
|
|
||||||
EXPAND_USER_LIST,
|
|
||||||
EXPAND_USER_LUA,
|
|
||||||
EXPAND_SHELLCMD,
|
|
||||||
EXPAND_SIGN,
|
|
||||||
EXPAND_PROFILE,
|
|
||||||
EXPAND_FILETYPE,
|
|
||||||
EXPAND_FILES_IN_PATH,
|
|
||||||
EXPAND_OWNSYNTAX,
|
|
||||||
EXPAND_LOCALES,
|
|
||||||
EXPAND_HISTORY,
|
|
||||||
EXPAND_USER,
|
|
||||||
EXPAND_SYNTIME,
|
|
||||||
EXPAND_USER_ADDR_TYPE,
|
|
||||||
EXPAND_PACKADD,
|
|
||||||
EXPAND_MESSAGES,
|
|
||||||
EXPAND_MAPCLEAR,
|
|
||||||
EXPAND_ARGLIST,
|
|
||||||
EXPAND_DIFF_BUFFERS,
|
|
||||||
EXPAND_BREAKPOINT,
|
|
||||||
EXPAND_SCRIPTNAMES,
|
|
||||||
EXPAND_RUNTIME,
|
|
||||||
EXPAND_STRING_SETTING,
|
|
||||||
EXPAND_SETTING_SUBTRACT,
|
|
||||||
EXPAND_CHECKHEALTH,
|
|
||||||
EXPAND_LUA,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Minimal size for block 0 of a swap file.
|
// Minimal size for block 0 of a swap file.
|
||||||
// NOTE: This depends on size of struct block0! It's not done with a sizeof(),
|
// NOTE: This depends on size of struct block0! It's not done with a sizeof(),
|
||||||
// because struct block0 is defined in memline.c (Sorry).
|
// because struct block0 is defined in memline.c (Sorry).
|
||||||
// The maximal block size is arbitrary.
|
// The maximal block size is arbitrary.
|
||||||
|
|
||||||
#define MIN_SWAP_PAGE_SIZE 1048
|
#define MIN_SWAP_PAGE_SIZE 1048
|
||||||
#define MAX_SWAP_PAGE_SIZE 50000
|
#define MAX_SWAP_PAGE_SIZE 50000
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user