diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-06-13 17:13:46 +0800 |
---|---|---|
committer | zeertzjq <zeertzjq@outlook.com> | 2022-06-14 20:58:34 +0800 |
commit | da41ca299f52d4e08a34344359c250a3058fd3c6 (patch) | |
tree | a934520f470634491186c118d4a64a0a414aaa72 /src/nvim/ex_cmds_defs.h | |
parent | cd9e08cb94663558891fdd46dfa58f662e947be5 (diff) | |
download | rneovim-da41ca299f52d4e08a34344359c250a3058fd3c6.tar.gz rneovim-da41ca299f52d4e08a34344359c250a3058fd3c6.tar.bz2 rneovim-da41ca299f52d4e08a34344359c250a3058fd3c6.zip |
vim-patch:8.2.1897: command modifiers are saved and set inconsistently
Problem: Command modifiers are saved and set inconsistently.
Solution: Separate parsing and applying command modifiers. Save values in
cmdmod_T.
https://github.com/vim/vim/commit/5661ed6c833e05467cab33cb9b1c535e7e5cc570
Cherry-pick: :0verbose fix from patch 8.2.4741
Diffstat (limited to 'src/nvim/ex_cmds_defs.h')
-rw-r--r-- | src/nvim/ex_cmds_defs.h | 23 |
1 files changed, 17 insertions, 6 deletions
diff --git a/src/nvim/ex_cmds_defs.h b/src/nvim/ex_cmds_defs.h index a5c9c6be2d..db76851c97 100644 --- a/src/nvim/ex_cmds_defs.h +++ b/src/nvim/ex_cmds_defs.h @@ -209,10 +209,6 @@ struct exarg { LineGetter getline; ///< Function used to get the next line void *cookie; ///< argument for getline() cstack_T *cstack; ///< condition stack for ":if" etc. - long verbose_save; ///< saved value of p_verbose - int save_msg_silent; ///< saved value of msg_silent - int did_esilent; ///< how many times emsg_silent was incremented - bool did_sandbox; ///< when true did sandbox++ }; #define FORCE_BIN 1 // ":edit ++bin file" @@ -251,6 +247,7 @@ struct expand { /// flag. This needs to be saved for recursive commands, put them in a /// structure for easy manipulation. typedef struct { + int cmod_flags; ///< CMOD_ flags, see below int split; ///< flags for win_split() int tab; ///< > 0 when ":tab" was used bool browse; ///< true to invoke file dialog @@ -262,18 +259,32 @@ typedef struct { bool keeppatterns; ///< true when ":keeppatterns" was used bool lockmarks; ///< true when ":lockmarks" was used bool noswapfile; ///< true when ":noswapfile" was used - char *save_ei; ///< saved value of 'eventignore' regmatch_T filter_regmatch; ///< set by :filter /pat/ bool filter_force; ///< set for :filter! + + int cmod_verbose; ///< non-zero to set 'verbose', -1 is used for zero override + + // values for undo_cmdmod() + char_u *cmod_save_ei; ///< saved value of 'eventignore' + int cmod_did_sandbox; ///< set when "sandbox" was incremented + long cmod_verbose_save; ///< if 'verbose' was set: value of p_verbose plus one + int cmod_save_msg_silent; ///< if non-zero: saved value of msg_silent + 1 + int cmod_did_esilent; ///< incremented when emsg_silent is } cmdmod_T; +#define CMOD_SANDBOX 0x01 +#define CMOD_SILENT 0x02 +#define CMOD_ERRSILENT 0x04 +#define CMOD_UNSILENT 0x08 +#define CMOD_NOAUTOCMD 0x10 + /// Stores command modifier info used by `nvim_parse_cmd` typedef struct { bool silent; bool emsg_silent; bool sandbox; bool noautocmd; - long verbose; + int verbose; ///< unlike cmod_verbose, -1 is used when unspecified and 0 for zero override cmdmod_T cmdmod; struct { bool file; |