Mercurial > vim
comparison src/ex_docmd.c @ 28457:4dcccb2673fe v8.2.4753
patch 8.2.4753: error from setting an option is silently ignored
Commit: https://github.com/vim/vim/commit/31e5c60a682840959cae6273ccadd9aae48c928d
Author: Bram Moolenaar <Bram@vim.org>
Date: Fri Apr 15 13:53:33 2022 +0100
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_().
author | Bram Moolenaar <Bram@vim.org> |
---|---|
date | Fri, 15 Apr 2022 15:00:04 +0200 |
parents | 367439b95aba |
children | 0ae0946ebf9b |
comparison
equal
deleted
inserted
replaced
28456:6353f897ac82 | 28457:4dcccb2673fe |
---|---|
9421 static void | 9421 static void |
9422 ex_behave(exarg_T *eap) | 9422 ex_behave(exarg_T *eap) |
9423 { | 9423 { |
9424 if (STRCMP(eap->arg, "mswin") == 0) | 9424 if (STRCMP(eap->arg, "mswin") == 0) |
9425 { | 9425 { |
9426 set_option_value((char_u *)"selection", 0L, (char_u *)"exclusive", 0); | 9426 set_option_value_give_err((char_u *)"selection", |
9427 set_option_value((char_u *)"selectmode", 0L, (char_u *)"mouse,key", 0); | 9427 0L, (char_u *)"exclusive", 0); |
9428 set_option_value((char_u *)"mousemodel", 0L, (char_u *)"popup", 0); | 9428 set_option_value_give_err((char_u *)"selectmode", |
9429 set_option_value((char_u *)"keymodel", 0L, | 9429 0L, (char_u *)"mouse,key", 0); |
9430 (char_u *)"startsel,stopsel", 0); | 9430 set_option_value_give_err((char_u *)"mousemodel", |
9431 0L, (char_u *)"popup", 0); | |
9432 set_option_value_give_err((char_u *)"keymodel", | |
9433 0L, (char_u *)"startsel,stopsel", 0); | |
9431 } | 9434 } |
9432 else if (STRCMP(eap->arg, "xterm") == 0) | 9435 else if (STRCMP(eap->arg, "xterm") == 0) |
9433 { | 9436 { |
9434 set_option_value((char_u *)"selection", 0L, (char_u *)"inclusive", 0); | 9437 set_option_value_give_err((char_u *)"selection", |
9435 set_option_value((char_u *)"selectmode", 0L, (char_u *)"", 0); | 9438 0L, (char_u *)"inclusive", 0); |
9436 set_option_value((char_u *)"mousemodel", 0L, (char_u *)"extend", 0); | 9439 set_option_value_give_err((char_u *)"selectmode", 0L, (char_u *)"", 0); |
9437 set_option_value((char_u *)"keymodel", 0L, (char_u *)"", 0); | 9440 set_option_value_give_err((char_u *)"mousemodel", |
9441 0L, (char_u *)"extend", 0); | |
9442 set_option_value_give_err((char_u *)"keymodel", 0L, (char_u *)"", 0); | |
9438 } | 9443 } |
9439 else | 9444 else |
9440 semsg(_(e_invalid_argument_str), eap->arg); | 9445 semsg(_(e_invalid_argument_str), eap->arg); |
9441 } | 9446 } |
9442 | 9447 |
9546 char_u *arg = eap->arg; | 9551 char_u *arg = eap->arg; |
9547 | 9552 |
9548 if (STRNCMP(arg, "FALLBACK ", 9) == 0) | 9553 if (STRNCMP(arg, "FALLBACK ", 9) == 0) |
9549 arg += 9; | 9554 arg += 9; |
9550 | 9555 |
9551 set_option_value((char_u *)"filetype", 0L, arg, OPT_LOCAL); | 9556 set_option_value_give_err((char_u *)"filetype", 0L, arg, OPT_LOCAL); |
9552 if (arg != eap->arg) | 9557 if (arg != eap->arg) |
9553 did_filetype = FALSE; | 9558 did_filetype = FALSE; |
9554 } | 9559 } |
9555 } | 9560 } |
9556 | 9561 |