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/ex_docmd.c b/src/ex_docmd.c
index ceb500d..47a12fd 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9423,18 +9423,23 @@
{
if (STRCMP(eap->arg, "mswin") == 0)
{
- set_option_value((char_u *)"selection", 0L, (char_u *)"exclusive", 0);
- set_option_value((char_u *)"selectmode", 0L, (char_u *)"mouse,key", 0);
- set_option_value((char_u *)"mousemodel", 0L, (char_u *)"popup", 0);
- set_option_value((char_u *)"keymodel", 0L,
- (char_u *)"startsel,stopsel", 0);
+ set_option_value_give_err((char_u *)"selection",
+ 0L, (char_u *)"exclusive", 0);
+ set_option_value_give_err((char_u *)"selectmode",
+ 0L, (char_u *)"mouse,key", 0);
+ set_option_value_give_err((char_u *)"mousemodel",
+ 0L, (char_u *)"popup", 0);
+ set_option_value_give_err((char_u *)"keymodel",
+ 0L, (char_u *)"startsel,stopsel", 0);
}
else if (STRCMP(eap->arg, "xterm") == 0)
{
- set_option_value((char_u *)"selection", 0L, (char_u *)"inclusive", 0);
- set_option_value((char_u *)"selectmode", 0L, (char_u *)"", 0);
- set_option_value((char_u *)"mousemodel", 0L, (char_u *)"extend", 0);
- set_option_value((char_u *)"keymodel", 0L, (char_u *)"", 0);
+ set_option_value_give_err((char_u *)"selection",
+ 0L, (char_u *)"inclusive", 0);
+ set_option_value_give_err((char_u *)"selectmode", 0L, (char_u *)"", 0);
+ set_option_value_give_err((char_u *)"mousemodel",
+ 0L, (char_u *)"extend", 0);
+ set_option_value_give_err((char_u *)"keymodel", 0L, (char_u *)"", 0);
}
else
semsg(_(e_invalid_argument_str), eap->arg);
@@ -9548,7 +9553,7 @@
if (STRNCMP(arg, "FALLBACK ", 9) == 0)
arg += 9;
- set_option_value((char_u *)"filetype", 0L, arg, OPT_LOCAL);
+ set_option_value_give_err((char_u *)"filetype", 0L, arg, OPT_LOCAL);
if (arg != eap->arg)
did_filetype = FALSE;
}