Mercurial > vim
comparison src/quickfix.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 | e015d650ea9f |
children | 18604231a1d1 |
comparison
equal
deleted
inserted
replaced
28456:6353f897ac82 | 28457:4dcccb2673fe |
---|---|
4171 */ | 4171 */ |
4172 static void | 4172 static void |
4173 qf_set_cwindow_options(void) | 4173 qf_set_cwindow_options(void) |
4174 { | 4174 { |
4175 // switch off 'swapfile' | 4175 // switch off 'swapfile' |
4176 set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL); | 4176 set_option_value_give_err((char_u *)"swf", 0L, NULL, OPT_LOCAL); |
4177 set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix", | 4177 set_option_value_give_err((char_u *)"bt", |
4178 OPT_LOCAL); | 4178 0L, (char_u *)"quickfix", OPT_LOCAL); |
4179 set_option_value((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); | 4179 set_option_value_give_err((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); |
4180 RESET_BINDING(curwin); | 4180 RESET_BINDING(curwin); |
4181 #ifdef FEAT_DIFF | 4181 #ifdef FEAT_DIFF |
4182 curwin->w_p_diff = FALSE; | 4182 curwin->w_p_diff = FALSE; |
4183 #endif | 4183 #endif |
4184 #ifdef FEAT_FOLDING | 4184 #ifdef FEAT_FOLDING |
4185 set_option_value((char_u *)"fdm", 0L, (char_u *)"manual", | 4185 set_option_value_give_err((char_u *)"fdm", 0L, (char_u *)"manual", |
4186 OPT_LOCAL); | 4186 OPT_LOCAL); |
4187 #endif | 4187 #endif |
4188 } | 4188 } |
4189 | 4189 |
4190 /* | 4190 /* |
4794 { | 4794 { |
4795 // Set the 'filetype' to "qf" each time after filling the buffer. | 4795 // Set the 'filetype' to "qf" each time after filling the buffer. |
4796 // This resembles reading a file into a buffer, it's more logical when | 4796 // This resembles reading a file into a buffer, it's more logical when |
4797 // using autocommands. | 4797 // using autocommands. |
4798 ++curbuf_lock; | 4798 ++curbuf_lock; |
4799 set_option_value((char_u *)"ft", 0L, (char_u *)"qf", OPT_LOCAL); | 4799 set_option_value_give_err((char_u *)"ft", |
4800 0L, (char_u *)"qf", OPT_LOCAL); | |
4800 curbuf->b_p_ma = FALSE; | 4801 curbuf->b_p_ma = FALSE; |
4801 | 4802 |
4802 keep_filetype = TRUE; // don't detect 'filetype' | 4803 keep_filetype = TRUE; // don't detect 'filetype' |
4803 apply_autocmds(EVENT_BUFREADPOST, (char_u *)"quickfix", NULL, | 4804 apply_autocmds(EVENT_BUFREADPOST, (char_u *)"quickfix", NULL, |
4804 FALSE, curbuf); | 4805 FALSE, curbuf); |
8310 else | 8311 else |
8311 { | 8312 { |
8312 // Darn, some plugin changed the value. If it's still empty it was | 8313 // Darn, some plugin changed the value. If it's still empty it was |
8313 // changed and restored, need to restore in the complicated way. | 8314 // changed and restored, need to restore in the complicated way. |
8314 if (*p_cpo == NUL) | 8315 if (*p_cpo == NUL) |
8315 set_option_value((char_u *)"cpo", 0L, save_cpo, 0); | 8316 set_option_value_give_err((char_u *)"cpo", 0L, save_cpo, 0); |
8316 if (save_cpo_allocated) | 8317 if (save_cpo_allocated) |
8317 free_string_option(save_cpo); | 8318 free_string_option(save_cpo); |
8318 } | 8319 } |
8319 | 8320 |
8320 if (updated) | 8321 if (updated) |