diff options
author | bfredl <bjorn.linse@gmail.com> | 2023-09-25 12:26:01 +0200 |
---|---|---|
committer | bfredl <bjorn.linse@gmail.com> | 2023-09-25 14:54:20 +0200 |
commit | 68d425ac92599089047d98f1c533981ea917fed1 (patch) | |
tree | 784aa8d4a6b4436fcd7af8004d619f4702c27bac /src/nvim/optionstr.c | |
parent | ccd1a84a9655279230be15630d4e5978c806c4e1 (diff) | |
download | rneovim-68d425ac92599089047d98f1c533981ea917fed1.tar.gz rneovim-68d425ac92599089047d98f1c533981ea917fed1.tar.bz2 rneovim-68d425ac92599089047d98f1c533981ea917fed1.zip |
refactor: remove 'shortmess' save/restore panic for ex commands
This was only used to avoid the effect of SHM_OVERALL. This can easily
be handled in isolation, instead of clearing out all of 'shortmess' which
has unwanted side effects and mystifies what really is going on.
Diffstat (limited to 'src/nvim/optionstr.c')
-rw-r--r-- | src/nvim/optionstr.c | 32 |
1 files changed, 0 insertions, 32 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index cf8e6cf641..2382219b55 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -69,8 +69,6 @@ static const char e_backupext_and_patchmode_are_equal[] = N_("E589: 'backupext' and 'patchmode' are equal"); static const char e_showbreak_contains_unprintable_or_wide_character[] = N_("E595: 'showbreak' contains unprintable or wide character"); -static const char e_internal_error_shortmess_too_long[] - = N_("E1336: Internal error: shortmess too long"); static char *(p_ambw_values[]) = { "single", "double", NULL }; static char *(p_bg_values[]) = { "light", "dark", NULL }; @@ -2269,36 +2267,6 @@ int check_ff_value(char *p) return check_opt_strings(p, p_ff_values, false); } -static char shm_buf[SHM_LEN]; -static int set_shm_recursive = 0; - -/// Save the actual shortmess Flags and clear them temporarily to avoid that -/// file messages overwrites any output from the following commands. -/// -/// Caller must make sure to first call save_clear_shm_value() and then -/// restore_shm_value() exactly the same number of times. -void save_clear_shm_value(void) -{ - if (strlen(p_shm) >= SHM_LEN) { - iemsg(e_internal_error_shortmess_too_long); - return; - } - - if (++set_shm_recursive == 1) { - STRCPY(shm_buf, p_shm); - set_option_value_give_err("shm", STATIC_CSTR_AS_OPTVAL(""), 0); - } -} - -/// Restore the shortmess Flags set from the save_clear_shm_value() function. -void restore_shm_value(void) -{ - if (--set_shm_recursive == 0) { - set_option_value_give_err("shm", CSTR_AS_OPTVAL(shm_buf), 0); - memset(shm_buf, 0, SHM_LEN); - } -} - static const char e_conflicts_with_value_of_listchars[] = N_("E834: Conflicts with value of 'listchars'"); static const char e_conflicts_with_value_of_fillchars[] |