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_().
diff --git a/src/term.c b/src/term.c
index 1c6aadc..8f3ee60 100644
--- a/src/term.c
+++ b/src/term.c
@@ -2029,7 +2029,7 @@
# 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 @@
// 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 @@
&& (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 @@
&& 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);
}