diff options
Diffstat (limited to 'src/nvim/ex_cmds_defs.h')
| -rw-r--r-- | src/nvim/ex_cmds_defs.h | 84 |
1 files changed, 44 insertions, 40 deletions
diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h index 21db3936b8..ca84d375ce 100644 --- a/src/nvim/ex_cmds_defs.h +++ b/src/nvim/ex_cmds_defs.h @@ -36,46 +36,50 @@ // 4. Add documentation in ../doc/xxx.txt. Add a tag for both the short and // long name of the command. -#define RANGE 0x001 // allow a linespecs -#define BANG 0x002 // allow a ! after the command name -#define EXTRA 0x004 // allow extra args after command name -#define XFILE 0x008 // expand wildcards in extra part -#define NOSPC 0x010 // no spaces allowed in the extra part -#define DFLALL 0x020 // default file range is 1,$ -#define WHOLEFOLD 0x040 // extend range to include whole fold also - // when less than two numbers given -#define NEEDARG 0x080 // argument required -#define TRLBAR 0x100 // check for trailing vertical bar -#define REGSTR 0x200 // allow "x for register designation -#define COUNT 0x400 // allow count in argument, after command -#define NOTRLCOM 0x800 // no trailing comment allowed -#define ZEROR 0x1000 // zero line number allowed -#define USECTRLV 0x2000 // do not remove CTRL-V from argument -#define NOTADR 0x4000 // number before command is not an address -#define EDITCMD 0x8000 // allow "+command" argument -#define BUFNAME 0x10000 // accepts buffer name -#define BUFUNL 0x20000 // accepts unlisted buffer too -#define ARGOPT 0x40000 // allow "++opt=val" argument -#define SBOXOK 0x80000 // allowed in the sandbox -#define CMDWIN 0x100000 // allowed in cmdline window; when missing - // disallows editing another buffer when - // curbuf_lock is set -#define MODIFY 0x200000 // forbidden in non-'modifiable' buffer -#define EXFLAGS 0x400000 // allow flags after count in argument -#define FILES (XFILE | EXTRA) // multiple extra files allowed -#define WORD1 (EXTRA | NOSPC) // one extra word allowed -#define FILE1 (FILES | NOSPC) // 1 file allowed, defaults to current file +#define EX_RANGE 0x001 // allow a linespecs +#define EX_BANG 0x002 // allow a ! after the command name +#define EX_EXTRA 0x004 // allow extra args after command name +#define EX_XFILE 0x008 // expand wildcards in extra part +#define EX_NOSPC 0x010 // no spaces allowed in the extra part +#define EX_DFLALL 0x020 // default file range is 1,$ +#define EX_WHOLEFOLD 0x040 // extend range to include whole fold also + // when less than two numbers given +#define EX_NEEDARG 0x080 // argument required +#define EX_TRLBAR 0x100 // check for trailing vertical bar +#define EX_REGSTR 0x200 // allow "x for register designation +#define EX_COUNT 0x400 // allow count in argument, after command +#define EX_NOTRLCOM 0x800 // no trailing comment allowed +#define EX_ZEROR 0x1000 // zero line number allowed +#define EX_CTRLV 0x2000 // do not remove CTRL-V from argument +#define EX_CMDARG 0x4000 // allow "+command" argument +#define EX_BUFNAME 0x8000 // accepts buffer name +#define EX_BUFUNL 0x10000 // accepts unlisted buffer too +#define EX_ARGOPT 0x20000 // allow "++opt=val" argument +#define EX_SBOXOK 0x40000 // allowed in the sandbox +#define EX_CMDWIN 0x80000 // allowed in cmdline window; when missing + // disallows editing another buffer when + // curbuf_lock is set +#define EX_MODIFY 0x100000 // forbidden in non-'modifiable' buffer +#define EX_FLAGS 0x200000 // allow flags after count in argument +#define EX_FILES (EX_XFILE | EX_EXTRA) // multiple extra files allowed +#define EX_FILE1 (EX_FILES | EX_NOSPC) // 1 file, defaults to current file +#define EX_WORD1 (EX_EXTRA | EX_NOSPC) // one extra word allowed // values for cmd_addr_type -#define ADDR_LINES 0 -#define ADDR_WINDOWS 1 -#define ADDR_ARGUMENTS 2 -#define ADDR_LOADED_BUFFERS 3 -#define ADDR_BUFFERS 4 -#define ADDR_TABS 5 -#define ADDR_TABS_RELATIVE 6 // Tab page that only relative -#define ADDR_QUICKFIX 7 -#define ADDR_OTHER 99 +typedef enum { + ADDR_LINES, // buffer line numbers + ADDR_WINDOWS, // window number + ADDR_ARGUMENTS, // argument number + ADDR_LOADED_BUFFERS, // buffer number of loaded buffer + ADDR_BUFFERS, // buffer number + ADDR_TABS, // tab page number + ADDR_TABS_RELATIVE, // Tab page that only relative + ADDR_QUICKFIX_VALID, // quickfix list valid entry number + ADDR_QUICKFIX, // quickfix list entry number + ADDR_UNSIGNED, // positive count or zero, defaults to 1 + ADDR_OTHER, // something else, use line number for '$', '%', etc. + ADDR_NONE // no range used +} cmd_addr_T; typedef struct exarg exarg_T; @@ -93,7 +97,7 @@ typedef struct cmdname { char_u *cmd_name; ///< Name of the command. ex_func_T cmd_func; ///< Function with implementation of this command. uint32_t cmd_argt; ///< Relevant flags from the declared above. - int cmd_addr_type; ///< Flag for address type + cmd_addr_T cmd_addr_type; ///< Flag for address type } CommandDefinition; // A list used for saving values of "emsg_silent". Used by ex_try() to save the @@ -150,7 +154,7 @@ struct exarg { int addr_count; ///< the number of addresses given linenr_T line1; ///< the first line number linenr_T line2; ///< the second line number or count - int addr_type; ///< type of the count/range + cmd_addr_T addr_type; ///< type of the count/range int flags; ///< extra flags after count: EXFLAG_ char_u *do_ecmd_cmd; ///< +command arg to be used in edited file linenr_T do_ecmd_lnum; ///< the line number in an edited file |