1
0
forked from aniani/vim

patch 8.2.4753: error from setting an option is silently ignored

Problem:    Error from setting an option is silently ignored.
Solution:   Handle option value errors better.  Fix uses of N_().
This commit is contained in:
Bram Moolenaar
2022-04-15 13:53:33 +01:00
parent 5dc294a7b6
commit 31e5c60a68
31 changed files with 155 additions and 116 deletions

View File

@@ -2029,7 +2029,7 @@ set_termname(char_u *term)
# endif
if (p != NULL)
{
set_option_value((char_u *)"ttym", 0L, p, 0);
set_option_value_give_err((char_u *)"ttym", 0L, p, 0);
// Reset the WAS_SET flag, 'ttymouse' can be set to "sgr" or
// "xterm2" in check_termcode().
reset_option_was_set((char_u *)"ttym");
@@ -4605,7 +4605,7 @@ handle_u7_response(int *arg, char_u *tp UNUSED, int csi_len UNUSED)
// Setting the option causes a screen redraw. Do
// that right away if possible, keeping any
// messages.
set_option_value((char_u *)"ambw", 0L, (char_u *)aw, 0);
set_option_value_give_err((char_u *)"ambw", 0L, (char_u *)aw, 0);
# ifdef DEBUG_TERMRESPONSE
{
int r = redraw_asap(CLEAR);
@@ -4816,7 +4816,7 @@ handle_version_response(int first, int *arg, int argc, char_u *tp)
&& (term_props[TPR_MOUSE].tpr_status == TPR_MOUSE_XTERM2
|| term_props[TPR_MOUSE].tpr_status == TPR_MOUSE_SGR))
{
set_option_value((char_u *)"ttym", 0L,
set_option_value_give_err((char_u *)"ttym", 0L,
term_props[TPR_MOUSE].tpr_status == TPR_MOUSE_SGR
? (char_u *)"sgr" : (char_u *)"xterm2", 0);
}
@@ -5140,8 +5140,8 @@ handle_osc(char_u *tp, char_u *argp, int len, char_u *key_name, int *slen)
&& STRCMP(p_bg, new_bg_val) != 0)
{
// value differs, apply it
set_option_value((char_u *)"bg", 0L,
(char_u *)new_bg_val, 0);
set_option_value_give_err((char_u *)"bg",
0L, (char_u *)new_bg_val, 0);
reset_option_was_set((char_u *)"bg");
redraw_asap(CLEAR);
}