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:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user