diff options
author | watiko <service@mail.watiko.net> | 2016-02-16 02:26:06 +0900 |
---|---|---|
committer | watiko <service@mail.watiko.net> | 2016-02-17 21:04:24 +0900 |
commit | 0d6cd2b8087d9ae7fdb2b70fcc40ecaf378b0af7 (patch) | |
tree | d25b632df283689a86a7e55cef9a1ce46f0f6454 | |
parent | 5b63488c25493a2f5a0734ad43ea422dab1c550b (diff) | |
download | rneovim-0d6cd2b8087d9ae7fdb2b70fcc40ecaf378b0af7.tar.gz rneovim-0d6cd2b8087d9ae7fdb2b70fcc40ecaf378b0af7.tar.bz2 rneovim-0d6cd2b8087d9ae7fdb2b70fcc40ecaf378b0af7.zip |
option_defs.h: Introduce SHM_ABBREVIATIONS
Helped-by: ZyX <kp-pav@yandex.ru>
-rw-r--r-- | src/nvim/option.c | 14 | ||||
-rw-r--r-- | src/nvim/option_defs.h | 8 |
2 files changed, 11 insertions, 11 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c index 4bf7ec5405..9aa2b145e8 100644 --- a/src/nvim/option.c +++ b/src/nvim/option.c @@ -6163,16 +6163,14 @@ int has_format_option(int x) return vim_strchr(curbuf->b_p_fo, x) != NULL; } -/* - * Return TRUE if "x" is present in 'shortmess' option, or - * 'shortmess' contains 'a' and "x" is present in SHM_A. - */ -int shortmess(int x) +/// @returns true if "x" is present in 'shortmess' option, or +/// 'shortmess' contains 'a' and "x" is present in SHM_ALL_ABBREVIATIONS. +bool shortmess(int x) { return p_shm != NULL && - ( vim_strchr(p_shm, x) != NULL - || (vim_strchr(p_shm, 'a') != NULL - && vim_strchr((char_u *)SHM_A, x) != NULL)); + (vim_strchr(p_shm, x) != NULL + || (vim_strchr(p_shm, 'a') != NULL + && vim_strchr((char_u *)SHM_ALL_ABBREVIATIONS, x) != NULL)); } /* diff --git a/src/nvim/option_defs.h b/src/nvim/option_defs.h index 688ed7d939..547bd9442c 100644 --- a/src/nvim/option_defs.h +++ b/src/nvim/option_defs.h @@ -161,6 +161,7 @@ enum { SHM_LINES = 'l', ///< "L" instead of "lines". SHM_NEW = 'n', ///< "[New]" instead of "[New file]". SHM_WRI = 'w', ///< "[w]" instead of "written". + SHM_ABBREVIATIONS = 'a', ///< Use abbreviations from #SHM_ALL_ABBREVIATIONS. SHM_WRITE = 'W', ///< Don't use "written" at all. SHM_TRUNC = 't', ///< Trunctate file messages. SHM_TRUNCALL = 'T', ///< Trunctate all messages. @@ -173,15 +174,16 @@ enum { SHM_RECORDING = 'q', ///< Short recording message. }; /// Represented by 'a' flag. -#define SHM_A ((char_u[]) { \ +#define SHM_ALL_ABBREVIATIONS ((char_u[]) { \ SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \ 0, \ }) /// All possible flags for 'shm'. #define SHM_ALL ((char_u[]) { \ SHM_RO, SHM_MOD, SHM_FILE, SHM_LAST, SHM_TEXT, SHM_LINES, SHM_NEW, SHM_WRI, \ - 'a', SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER, SHM_OVERALL, SHM_SEARCH, \ - SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU, SHM_RECORDING, \ + SHM_ABBREVIATIONS, SHM_WRITE, SHM_TRUNC, SHM_TRUNCALL, SHM_OVER, \ + SHM_OVERALL, SHM_SEARCH, SHM_ATTENTION, SHM_INTRO, SHM_COMPLETIONMENU, \ + SHM_RECORDING, \ 0, \ }) |