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/quickfix.c b/src/quickfix.c
index 0b44dca..aab1683 100644
--- a/src/quickfix.c
+++ b/src/quickfix.c
@@ -4173,16 +4173,16 @@
qf_set_cwindow_options(void)
{
// switch off 'swapfile'
- set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL);
- set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix",
- OPT_LOCAL);
- set_option_value((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL);
+ set_option_value_give_err((char_u *)"swf", 0L, NULL, OPT_LOCAL);
+ set_option_value_give_err((char_u *)"bt",
+ 0L, (char_u *)"quickfix", OPT_LOCAL);
+ set_option_value_give_err((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL);
RESET_BINDING(curwin);
#ifdef FEAT_DIFF
curwin->w_p_diff = FALSE;
#endif
#ifdef FEAT_FOLDING
- set_option_value((char_u *)"fdm", 0L, (char_u *)"manual",
+ set_option_value_give_err((char_u *)"fdm", 0L, (char_u *)"manual",
OPT_LOCAL);
#endif
}
@@ -4796,7 +4796,8 @@
// This resembles reading a file into a buffer, it's more logical when
// using autocommands.
++curbuf_lock;
- set_option_value((char_u *)"ft", 0L, (char_u *)"qf", OPT_LOCAL);
+ set_option_value_give_err((char_u *)"ft",
+ 0L, (char_u *)"qf", OPT_LOCAL);
curbuf->b_p_ma = FALSE;
keep_filetype = TRUE; // don't detect 'filetype'
@@ -8312,7 +8313,7 @@
// Darn, some plugin changed the value. If it's still empty it was
// changed and restored, need to restore in the complicated way.
if (*p_cpo == NUL)
- set_option_value((char_u *)"cpo", 0L, save_cpo, 0);
+ set_option_value_give_err((char_u *)"cpo", 0L, save_cpo, 0);
if (save_cpo_allocated)
free_string_option(save_cpo);
}