summaryrefslogtreecommitdiffstats
path: root/src/ex_docmd.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2022-04-15 13:53:33 +0100
committerBram Moolenaar <Bram@vim.org>2022-04-15 13:53:33 +0100
commit31e5c60a682840959cae6273ccadd9aae48c928d (patch)
treea72168baa32f1899937f3937a41b0832eac66b8f /src/ex_docmd.c
parent5dc294a7b63ed0e508dd360bc4d98173f1a1aeec (diff)
patch 8.2.4753: error from setting an option is silently ignoredv8.2.4753
Problem: Error from setting an option is silently ignored. Solution: Handle option value errors better. Fix uses of N_().
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r--src/ex_docmd.c25
1 files changed, 15 insertions, 10 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c
index ceb500dc13..47a12fd2cf 100644
--- a/src/ex_docmd.c
+++ b/src/ex_docmd.c
@@ -9423,18 +9423,23 @@ ex_behave(exarg_T *eap)
{
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 @@ ex_setfiletype(exarg_T *eap)
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;
}