To: vim_dev@googlegroups.com Subject: Patch 8.2.4753 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.4753 Problem: Error from setting an option is silently ignored. Solution: Handle option value errors better. Fix uses of N_(). Files: src/option.c, src/proto/option.pro, src/optionstr.c, src/channel.c, src/crypt.c, src/diff.c, src/edit.c, src/eval.c, src/evalfunc.c, src/evalvars.c, src/ex_cmds2.c, src/ex_docmd.c, src/ex_getln.c, src/getchar.c, src/gui.c, src/gui_gtk_x11.c, src/help.c, src/highlight.c, src/if_tcl.c, src/main.c, src/memline.c, src/message_test.c, src/popupmenu.c, src/quickfix.c, src/scriptfile.c, src/spell.c, src/spellfile.c, src/term.c, src/undo.c, src/vim9script.c, *** ../vim-8.2.4752/src/option.c 2022-04-10 11:26:00.941539608 +0100 --- src/option.c 2022-04-15 13:42:01.627039563 +0100 *************** *** 331,337 **** #ifdef FEAT_GUI if (found_reverse_arg) ! set_option_value((char_u *)"bg", 0L, (char_u *)"dark", 0); #endif curbuf->b_p_initialized = TRUE; --- 331,337 ---- #ifdef FEAT_GUI if (found_reverse_arg) ! set_option_value_give_err((char_u *)"bg", 0L, (char_u *)"dark", 0); #endif curbuf->b_p_initialized = TRUE; *************** *** 389,395 **** // NOTE: mlterm's author is being asked to 'set' a variable // instead of an environment variable due to inheritance. if (mch_getenv((char_u *)"MLTERM") != NULL) ! set_option_value((char_u *)"tbidi", 1L, NULL, 0); #endif didset_options2(); --- 389,395 ---- // NOTE: mlterm's author is being asked to 'set' a variable // instead of an environment variable due to inheritance. if (mch_getenv((char_u *)"MLTERM") != NULL) ! set_option_value_give_err((char_u *)"tbidi", 1L, NULL, 0); #endif didset_options2(); *************** *** 1406,1412 **** && vim_strchr((char_u *)"!&<", *arg) != NULL) errmsg = e_no_white_space_allowed_between_option_and; else ! errmsg = N_(e_unknown_option); goto skip; } --- 1406,1412 ---- && vim_strchr((char_u *)"!&<", *arg) != NULL) errmsg = e_no_white_space_allowed_between_option_and; else ! errmsg = e_unknown_option; goto skip; } *************** *** 1419,1425 **** if (vim_strchr((char_u *)"=:!&<", nextchar) == NULL && (!(options[opt_idx].flags & P_BOOL) || nextchar == '?')) ! errmsg = N_(e_option_not_supported); goto skip; } --- 1419,1425 ---- if (vim_strchr((char_u *)"=:!&<", nextchar) == NULL && (!(options[opt_idx].flags & P_BOOL) || nextchar == '?')) ! errmsg = e_option_not_supported; goto skip; } *************** *** 1457,1468 **** { if (flags & (P_SECURE | P_NO_ML)) { ! errmsg = N_(e_not_allowed_in_modeline); goto skip; } if ((flags & P_MLE) && !p_mle) { ! errmsg = N_(e_not_allowed_in_modeline_when_modelineexpr_is_off); goto skip; } #ifdef FEAT_DIFF --- 1457,1468 ---- { if (flags & (P_SECURE | P_NO_ML)) { ! errmsg = e_not_allowed_in_modeline; goto skip; } if ((flags & P_MLE) && !p_mle) { ! errmsg = e_not_allowed_in_modeline_when_modelineexpr_is_off; goto skip; } #ifdef FEAT_DIFF *************** *** 1558,1564 **** p = find_termcode(key_name); if (p == NULL) { ! errmsg = N_(e_key_code_not_set); goto skip; } else --- 1558,1564 ---- p = find_termcode(key_name); if (p == NULL) { ! errmsg = e_key_code_not_set; goto skip; } else *************** *** 1682,1694 **** if (i == 0 || (arg[i] != NUL && !VIM_ISWHITE(arg[i]))) { ! errmsg = N_(e_number_required_after_equal); goto skip; } } else { ! errmsg = N_(e_number_required_after_equal); goto skip; } --- 1682,1694 ---- if (i == 0 || (arg[i] != NUL && !VIM_ISWHITE(arg[i]))) { ! errmsg = e_number_required_after_equal; goto skip; } } else { ! errmsg = e_number_required_after_equal; goto skip; } *************** *** 2140,2146 **** if (nextchar == '&') { if (add_termcap_entry(key_name, TRUE) == FAIL) ! errmsg = N_(e_not_found_in_termcap); } else { --- 2140,2146 ---- if (nextchar == '&') { if (add_termcap_entry(key_name, TRUE) == FAIL) ! errmsg = e_not_found_in_termcap; } else { *************** *** 2724,2729 **** --- 2724,2730 ---- #if defined(FEAT_EVAL) int old_global_value = 0; #endif + char *errmsg = NULL; // Disallow changing some options from secure mode if ((secure *************** *** 2838,2844 **** && curbuf->b_term != NULL && !term_is_finished(curbuf)))) { curbuf->b_p_ma = FALSE; ! return N_(e_cannot_make_terminal_with_running_job_modifiable); } # endif redraw_titles(); --- 2839,2845 ---- && curbuf->b_term != NULL && !term_is_finished(curbuf)))) { curbuf->b_p_ma = FALSE; ! return e_cannot_make_terminal_with_running_job_modifiable; } # endif redraw_titles(); *************** *** 2966,2972 **** if (win->w_p_pvw && win != curwin) { curwin->w_p_pvw = FALSE; ! return N_(e_preview_window_already_exists); } } } --- 2967,2973 ---- if (win->w_p_pvw && win != curwin) { curwin->w_p_pvw = FALSE; ! return e_preview_window_already_exists; } } } *************** *** 3121,3132 **** else if ((int *)varp == &curwin->w_p_spell) { if (curwin->w_p_spell) ! { ! char *errmsg = did_set_spelllang(curwin); ! ! if (errmsg != NULL) ! emsg(_(errmsg)); ! } } #endif --- 3122,3128 ---- else if ((int *)varp == &curwin->w_p_spell) { if (curwin->w_p_spell) ! errmsg = did_set_spelllang(curwin); } #endif *************** *** 3173,3180 **** # ifdef FEAT_KEYMAP // Force-set the necessary keymap for arabic ! set_option_value((char_u *)"keymap", 0L, (char_u *)"arabic", ! OPT_LOCAL); # endif } else --- 3169,3176 ---- # ifdef FEAT_KEYMAP // Force-set the necessary keymap for arabic ! errmsg = set_option_value((char_u *)"keymap", ! 0L, (char_u *)"arabic", OPT_LOCAL); # endif } else *************** *** 3239,3245 **** !has_vtp_working()) { p_tgc = 0; ! return N_(e_24_bit_colors_are_not_supported_on_this_environment); } if (is_term_win32()) swap_tcap(); --- 3235,3241 ---- !has_vtp_working()) { p_tgc = 0; ! return e_24_bit_colors_are_not_supported_on_this_environment; } if (is_term_win32()) swap_tcap(); *************** *** 3287,3293 **** if ((opt_flags & OPT_NO_REDRAW) == 0) check_redraw(options[opt_idx].flags); ! return NULL; } /* --- 3283,3289 ---- if ((opt_flags & OPT_NO_REDRAW) == 0) check_redraw(options[opt_idx].flags); ! return errmsg; } /* *************** *** 4329,4335 **** * Set the value of option "name". * Use "string" for string options, use "number" for other options. * ! * Returns NULL on success or error message on error. */ char * set_option_value( --- 4325,4331 ---- * Set the value of option "name". * Use "string" for string options, use "number" for other options. * ! * Returns NULL on success or an untranslated error message on error. */ char * set_option_value( *************** *** 4419,4424 **** --- 4415,4436 ---- } /* + * Call set_option_value() and when an error is returned report it. + */ + void + set_option_value_give_err( + char_u *name, + long number, + char_u *string, + int opt_flags) // OPT_LOCAL or 0 (both) + { + char *errmsg = set_option_value(name, number, string, opt_flags); + + if (errmsg != NULL) + emsg(_(errmsg)); + } + + /* * Get the terminal code for a terminal option. * Returns NULL when not found. */ *** ../vim-8.2.4752/src/proto/option.pro 2022-02-24 13:28:36.570222354 +0000 --- src/proto/option.pro 2022-04-15 13:24:18.622306215 +0100 *************** *** 38,43 **** --- 38,44 ---- int is_hidden_option(int opt_idx); int is_crypt_key_option(int opt_idx); char *set_option_value(char_u *name, long number, char_u *string, int opt_flags); + void set_option_value_give_err(char_u *name, long number, char_u *string, int opt_flags); char_u *get_term_code(char_u *tname); char_u *get_highlight_default(void); char_u *get_encoding_default(void); *************** *** 63,69 **** void set_iminsert_global(void); void set_imsearch_global(void); void set_context_in_set_cmd(expand_T *xp, char_u *arg, int opt_flags); ! int ExpandSettings(expand_T *xp, regmatch_T *regmatch, char_u *pat, int *numMatches, char_u ***matches); int ExpandOldSetting(int *num_file, char_u ***file); int shortmess(int x); void vimrc_found(char_u *fname, char_u *envname); --- 64,70 ---- void set_iminsert_global(void); void set_imsearch_global(void); void set_context_in_set_cmd(expand_T *xp, char_u *arg, int opt_flags); ! int ExpandSettings(expand_T *xp, regmatch_T *regmatch, char_u *fuzzystr, int *numMatches, char_u ***matches); int ExpandOldSetting(int *num_file, char_u ***file); int shortmess(int x); void vimrc_found(char_u *fname, char_u *envname); *** ../vim-8.2.4752/src/optionstr.c 2022-04-15 13:17:54.386867455 +0100 --- src/optionstr.c 2022-04-15 13:15:37.439086419 +0100 *************** *** 484,490 **** /* * Set a string option to a new value, and handle the effects. * ! * Returns NULL on success or error message on error. */ char * set_string_option( --- 484,490 ---- /* * Set a string option to a new value, and handle the effects. * ! * Returns NULL on success or an untranslated error message on error. */ char * set_string_option( *************** *** 503,509 **** char_u *saved_oldval_g = NULL; char_u *saved_newval = NULL; #endif ! char *r = NULL; int value_checked = FALSE; if (is_hidden_option(opt_idx)) // don't set hidden option --- 503,509 ---- char_u *saved_oldval_g = NULL; char_u *saved_newval = NULL; #endif ! char *errmsg = NULL; int value_checked = FALSE; if (is_hidden_option(opt_idx)) // don't set hidden option *************** *** 542,554 **** saved_newval = vim_strsave(s); } #endif ! if ((r = did_set_string_option(opt_idx, varp, TRUE, oldval, NULL, opt_flags, &value_checked)) == NULL) did_set_option(opt_idx, opt_flags, TRUE, value_checked); #if defined(FEAT_EVAL) // call autocommand after handling side effects ! if (r == NULL) trigger_optionsset_string(opt_idx, opt_flags, saved_oldval, saved_oldval_l, saved_oldval_g, saved_newval); --- 542,554 ---- saved_newval = vim_strsave(s); } #endif ! if ((errmsg = did_set_string_option(opt_idx, varp, TRUE, oldval, NULL, opt_flags, &value_checked)) == NULL) did_set_option(opt_idx, opt_flags, TRUE, value_checked); #if defined(FEAT_EVAL) // call autocommand after handling side effects ! if (errmsg == NULL) trigger_optionsset_string(opt_idx, opt_flags, saved_oldval, saved_oldval_l, saved_oldval_g, saved_newval); *************** *** 558,564 **** vim_free(saved_newval); #endif } ! return r; } /* --- 558,564 ---- vim_free(saved_newval); #endif } ! return errmsg; } /* *************** *** 753,759 **** { if (STRCMP(*p_bex == '.' ? p_bex + 1 : p_bex, *p_pm == '.' ? p_pm + 1 : p_pm) == 0) ! errmsg = N_(e_backupext_and_patchmode_are_equal); } #ifdef FEAT_LINEBREAK // 'breakindentopt' --- 753,759 ---- { if (STRCMP(*p_bex == '.' ? p_bex + 1 : p_bex, *p_pm == '.' ? p_pm + 1 : p_pm) == 0) ! errmsg = e_backupext_and_patchmode_are_equal; } #ifdef FEAT_LINEBREAK // 'breakindentopt' *************** *** 878,884 **** if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK) errmsg = e_invalid_argument; else if (set_chars_option(curwin, &p_fcs) != NULL) ! errmsg = _(e_conflicts_with_value_of_fillchars); else { tabpage_T *tp; --- 878,884 ---- if (check_opt_strings(p_ambw, p_ambw_values, FALSE) != OK) errmsg = e_invalid_argument; else if (set_chars_option(curwin, &p_fcs) != NULL) ! errmsg = e_conflicts_with_value_of_fillchars; else { tabpage_T *tp; *************** *** 888,894 **** { if (set_chars_option(wp, &wp->w_p_lcs) != NULL) { ! errmsg = _(e_conflicts_with_value_of_listchars); goto ambw_end; } } --- 888,894 ---- { if (set_chars_option(wp, &wp->w_p_lcs) != NULL) { ! errmsg = e_conflicts_with_value_of_listchars; goto ambw_end; } } *************** *** 1492,1498 **** for (s = *varp; *s; ) { if (ptr2cells(s) != 1) ! errmsg = N_(e_showbreak_contains_unprintable_or_wide_character); MB_PTR_ADV(s); } } --- 1492,1498 ---- for (s = *varp; *s; ) { if (ptr2cells(s) != 1) ! errmsg = e_showbreak_contains_unprintable_or_wide_character; MB_PTR_ADV(s); } } *************** *** 1534,1540 **** } else # endif ! errmsg = N_(e_invalid_fonts); } } redraw_gui_only = TRUE; --- 1534,1540 ---- } else # endif ! errmsg = e_invalid_fonts; } } redraw_gui_only = TRUE; *************** *** 1543,1551 **** else if (varp == &p_guifontset) { if (STRCMP(p_guifontset, "*") == 0) ! errmsg = N_(e_cant_select_fontset); else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK) ! errmsg = N_(e_invalid_fontset); redraw_gui_only = TRUE; } # endif --- 1543,1551 ---- else if (varp == &p_guifontset) { if (STRCMP(p_guifontset, "*") == 0) ! errmsg = e_cant_select_fontset; else if (gui.in_use && gui_init_font(p_guifontset, TRUE) != OK) ! errmsg = e_invalid_fontset; redraw_gui_only = TRUE; } # endif *** ../vim-8.2.4752/src/channel.c 2022-04-12 15:08:36.673207621 +0100 --- src/channel.c 2022-04-15 13:24:48.926264262 +0100 *************** *** 1183,1190 **** buf_copy_options(buf, BCO_ENTER); curbuf = buf; #ifdef FEAT_QUICKFIX ! set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL); ! set_option_value((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); #endif if (curbuf->b_ml.ml_mfp == NULL) ml_open(curbuf); --- 1183,1191 ---- buf_copy_options(buf, BCO_ENTER); curbuf = buf; #ifdef FEAT_QUICKFIX ! set_option_value_give_err((char_u *)"bt", ! 0L, (char_u *)"nofile", OPT_LOCAL); ! set_option_value_give_err((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); #endif if (curbuf->b_ml.ml_mfp == NULL) ml_open(curbuf); *** ../vim-8.2.4752/src/crypt.c 2022-03-07 15:16:11.461689545 +0000 --- src/crypt.c 2022-04-15 13:25:20.078221409 +0100 *************** *** 752,758 **** // encryption uses padding and MAC, that does not work very well with // swap and undo files, so disable them mf_close_file(curbuf, TRUE); // remove the swap file ! set_option_value((char_u *)"swf", 0, NULL, OPT_LOCAL); msg_scroll = TRUE; msg(_("Note: Encryption of swapfile not supported, disabling swap file")); } --- 752,758 ---- // encryption uses padding and MAC, that does not work very well with // swap and undo files, so disable them mf_close_file(curbuf, TRUE); // remove the swap file ! set_option_value_give_err((char_u *)"swf", 0, NULL, OPT_LOCAL); msg_scroll = TRUE; msg(_("Note: Encryption of swapfile not supported, disabling swap file")); } *************** *** 807,813 **** if (store) { ! set_option_value((char_u *)"key", 0L, p1, OPT_LOCAL); crypt_free_key(p1); p1 = curbuf->b_p_key; #ifdef FEAT_SODIUM --- 807,813 ---- if (store) { ! set_option_value_give_err((char_u *)"key", 0L, p1, OPT_LOCAL); crypt_free_key(p1); p1 = curbuf->b_p_key; #ifdef FEAT_SODIUM *** ../vim-8.2.4752/src/diff.c 2022-03-25 14:46:43.957805290 +0000 --- src/diff.c 2022-04-15 13:25:28.778209474 +0100 *************** *** 1466,1472 **** curwin = wp; curbuf = curwin->w_buffer; ++curbuf_lock; ! set_option_value((char_u *)"diff", (long)value, NULL, OPT_LOCAL); --curbuf_lock; curwin = old_curwin; curbuf = curwin->w_buffer; --- 1466,1472 ---- curwin = wp; curbuf = curwin->w_buffer; ++curbuf_lock; ! set_option_value_give_err((char_u *)"diff", (long)value, NULL, OPT_LOCAL); --curbuf_lock; curwin = old_curwin; curbuf = curwin->w_buffer; *** ../vim-8.2.4752/src/edit.c 2022-04-12 11:32:41.424327323 +0100 --- src/edit.c 2022-04-15 13:26:00.094166734 +0100 *************** *** 4407,4413 **** if (!p_paste) // Also have the side effects of setting 'paste' to make it work much // faster. ! set_option_value((char_u *)"paste", TRUE, NULL, 0); for (;;) { --- 4407,4413 ---- if (!p_paste) // Also have the side effects of setting 'paste' to make it work much // faster. ! set_option_value_give_err((char_u *)"paste", TRUE, NULL, 0); for (;;) { *************** *** 4482,4488 **** --no_mapping; allow_keys = save_allow_keys; if (!save_paste) ! set_option_value((char_u *)"paste", FALSE, NULL, 0); return ret_char; } --- 4482,4488 ---- --no_mapping; allow_keys = save_allow_keys; if (!save_paste) ! set_option_value_give_err((char_u *)"paste", FALSE, NULL, 0); return ret_char; } *** ../vim-8.2.4752/src/eval.c 2022-04-11 13:05:11.855669449 +0100 --- src/eval.c 2022-04-15 13:26:11.414151337 +0100 *************** *** 6801,6807 **** // If it's still empty it was changed and restored, need to restore in // the complicated way. if (*p_cpo == NUL) ! set_option_value((char_u *)"cpo", 0L, save_cpo, 0); free_string_option(save_cpo); } --- 6801,6807 ---- // If it's still empty it was changed and restored, need to restore in // the complicated way. if (*p_cpo == NUL) ! set_option_value_give_err((char_u *)"cpo", 0L, save_cpo, 0); free_string_option(save_cpo); } *** ../vim-8.2.4752/src/evalfunc.c 2022-04-12 12:54:06.917010952 +0100 --- src/evalfunc.c 2022-04-15 13:26:23.002135583 +0100 *************** *** 9060,9066 **** // If it's still empty it was changed and restored, need to restore in // the complicated way. if (*p_cpo == NUL) ! set_option_value((char_u *)"cpo", 0L, save_cpo, 0); free_string_option(save_cpo); } --- 9060,9066 ---- // If it's still empty it was changed and restored, need to restore in // the complicated way. if (*p_cpo == NUL) ! set_option_value_give_err((char_u *)"cpo", 0L, save_cpo, 0); free_string_option(save_cpo); } *** ../vim-8.2.4752/src/evalvars.c 2022-04-05 21:40:32.107458262 +0100 --- src/evalvars.c 2022-04-15 13:26:39.186113673 +0100 *************** *** 4014,4020 **** strval = tv_get_string_buf_chk(varp, nbuf); } if (!error && strval != NULL) ! set_option_value(varname, numval, strval, OPT_LOCAL); } /* --- 4014,4020 ---- strval = tv_get_string_buf_chk(varp, nbuf); } if (!error && strval != NULL) ! set_option_value_give_err(varname, numval, strval, OPT_LOCAL); } /* *** ../vim-8.2.4752/src/ex_cmds2.c 2022-01-05 20:24:34.272005652 +0000 --- src/ex_cmds2.c 2022-04-15 13:27:41.010030475 +0100 *************** *** 563,571 **** // Clear 'shm' to avoid that the file message overwrites // any output from the command. p_shm_save = vim_strsave(p_shm); ! set_option_value((char_u *)"shm", 0L, (char_u *)"", 0); do_argfile(eap, i); ! set_option_value((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); } if (curwin->w_arg_idx != i) --- 563,573 ---- // Clear 'shm' to avoid that the file message overwrites // any output from the command. p_shm_save = vim_strsave(p_shm); ! set_option_value_give_err((char_u *)"shm", ! 0L, (char_u *)"", 0); do_argfile(eap, i); ! set_option_value_give_err((char_u *)"shm", ! 0L, p_shm_save, 0); vim_free(p_shm_save); } if (curwin->w_arg_idx != i) *************** *** 623,631 **** // Go to the next buffer. Clear 'shm' to avoid that the file // message overwrites any output from the command. p_shm_save = vim_strsave(p_shm); ! set_option_value((char_u *)"shm", 0L, (char_u *)"", 0); goto_buffer(eap, DOBUF_FIRST, FORWARD, next_fnum); ! set_option_value((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); // If autocommands took us elsewhere, quit here. --- 625,633 ---- // Go to the next buffer. Clear 'shm' to avoid that the file // message overwrites any output from the command. p_shm_save = vim_strsave(p_shm); ! set_option_value_give_err((char_u *)"shm", 0L, (char_u *)"", 0); goto_buffer(eap, DOBUF_FIRST, FORWARD, next_fnum); ! set_option_value_give_err((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); // If autocommands took us elsewhere, quit here. *************** *** 645,653 **** // Clear 'shm' to avoid that the file message overwrites // any output from the command. p_shm_save = vim_strsave(p_shm); ! set_option_value((char_u *)"shm", 0L, (char_u *)"", 0); ex_cnext(eap); ! set_option_value((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); // If jumping to the next quickfix entry fails, quit here --- 647,655 ---- // Clear 'shm' to avoid that the file message overwrites // any output from the command. p_shm_save = vim_strsave(p_shm); ! set_option_value_give_err((char_u *)"shm", 0L, (char_u *)"", 0); ex_cnext(eap); ! set_option_value_give_err((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); // If jumping to the next quickfix entry fails, quit here *** ../vim-8.2.4752/src/ex_docmd.c 2022-04-12 14:22:46.894838163 +0100 --- src/ex_docmd.c 2022-04-15 13:28:57.505928553 +0100 *************** *** 9423,9440 **** { 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); } 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); } else semsg(_(e_invalid_argument_str), eap->arg); --- 9423,9445 ---- { if (STRCMP(eap->arg, "mswin") == 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_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,9554 **** if (STRNCMP(arg, "FALLBACK ", 9) == 0) arg += 9; ! set_option_value((char_u *)"filetype", 0L, arg, OPT_LOCAL); if (arg != eap->arg) did_filetype = FALSE; } --- 9553,9559 ---- if (STRNCMP(arg, "FALLBACK ", 9) == 0) arg += 9; ! set_option_value_give_err((char_u *)"filetype", 0L, arg, OPT_LOCAL); if (arg != eap->arg) did_filetype = FALSE; } *** ../vim-8.2.4752/src/ex_getln.c 2022-04-09 18:17:30.056746549 +0100 --- src/ex_getln.c 2022-04-15 13:29:21.989896156 +0100 *************** *** 4367,4373 **** apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf); (void)setfname(curbuf, (char_u *)_("[Command Line]"), NULL, TRUE); apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf); ! set_option_value((char_u *)"bt", 0L, (char_u *)"nofile", OPT_LOCAL); curbuf->b_p_ma = TRUE; #ifdef FEAT_FOLDING curwin->w_p_fen = FALSE; --- 4367,4374 ---- apply_autocmds(EVENT_BUFFILEPRE, NULL, NULL, FALSE, curbuf); (void)setfname(curbuf, (char_u *)_("[Command Line]"), NULL, TRUE); apply_autocmds(EVENT_BUFFILEPOST, NULL, NULL, FALSE, curbuf); ! set_option_value_give_err((char_u *)"bt", ! 0L, (char_u *)"nofile", OPT_LOCAL); curbuf->b_p_ma = TRUE; #ifdef FEAT_FOLDING curwin->w_p_fen = FALSE; *************** *** 4392,4398 **** add_map((char_u *)" ", INSERT); add_map((char_u *)" a", NORMAL); } ! set_option_value((char_u *)"ft", 0L, (char_u *)"vim", OPT_LOCAL); } --curbuf_lock; --- 4393,4400 ---- add_map((char_u *)" ", INSERT); add_map((char_u *)" a", NORMAL); } ! set_option_value_give_err((char_u *)"ft", ! 0L, (char_u *)"vim", OPT_LOCAL); } --curbuf_lock; *** ../vim-8.2.4752/src/getchar.c 2022-04-09 17:58:45.089690780 +0100 --- src/getchar.c 2022-04-15 13:29:36.365877175 +0100 *************** *** 2645,2651 **** mlen - typebuf.tb_maplen); del_typebuf(mlen, 0); // remove the chars ! set_option_value((char_u *)"paste", (long)!p_paste, NULL, 0); if (!(State & INSERT)) { msg_col = 0; --- 2645,2652 ---- mlen - typebuf.tb_maplen); del_typebuf(mlen, 0); // remove the chars ! set_option_value_give_err((char_u *)"paste", ! (long)!p_paste, NULL, 0); if (!(State & INSERT)) { msg_col = 0; *** ../vim-8.2.4752/src/gui.c 2022-04-12 11:32:41.428327316 +0100 --- src/gui.c 2022-04-15 13:30:07.761835843 +0100 *************** *** 504,510 **** * Reset 'paste'. It's useful in the terminal, but not in the GUI. It * breaks the Paste toolbar button. */ ! set_option_value((char_u *)"paste", 0L, NULL, 0); // Set t_Co to the number of colors: RGB. set_color_count(256 * 256 * 256); --- 504,510 ---- * Reset 'paste'. It's useful in the terminal, but not in the GUI. It * breaks the Paste toolbar button. */ ! set_option_value_give_err((char_u *)"paste", 0L, NULL, 0); // Set t_Co to the number of colors: RGB. set_color_count(256 * 256 * 256); *************** *** 664,670 **** * Set up the fonts. First use a font specified with "-fn" or "-font". */ if (font_argument != NULL) ! set_option_value((char_u *)"gfn", 0L, (char_u *)font_argument, 0); if ( #ifdef FEAT_XFONTSET (*p_guifontset == NUL --- 664,671 ---- * Set up the fonts. First use a font specified with "-fn" or "-font". */ if (font_argument != NULL) ! set_option_value_give_err((char_u *)"gfn", ! 0L, (char_u *)font_argument, 0); if ( #ifdef FEAT_XFONTSET (*p_guifontset == NUL *************** *** 4814,4820 **** // background color, unless the user has set it already. if (!option_was_set((char_u *)"bg") && STRCMP(p_bg, gui_bg_default()) != 0) { ! set_option_value((char_u *)"bg", 0L, gui_bg_default(), 0); highlight_changed(); } } --- 4815,4821 ---- // background color, unless the user has set it already. if (!option_was_set((char_u *)"bg") && STRCMP(p_bg, gui_bg_default()) != 0) { ! set_option_value_give_err((char_u *)"bg", 0L, gui_bg_default(), 0); highlight_changed(); } } *** ../vim-8.2.4752/src/gui_gtk_x11.c 2022-01-01 14:19:44.040353857 +0000 --- src/gui_gtk_x11.c 2022-04-15 13:30:15.649825478 +0100 *************** *** 3462,3468 **** * did_set_string_option() in option.c prohibits changing 'termencoding' * to something else than UTF-8 if the GUI is in use. */ ! set_option_value((char_u *)"termencoding", 0L, (char_u *)"utf-8", 0); #ifdef FEAT_TOOLBAR gui_gtk_register_stock_icons(); --- 3462,3469 ---- * did_set_string_option() in option.c prohibits changing 'termencoding' * to something else than UTF-8 if the GUI is in use. */ ! set_option_value_give_err((char_u *)"termencoding", ! 0L, (char_u *)"utf-8", 0); #ifdef FEAT_TOOLBAR gui_gtk_register_stock_icons(); *** ../vim-8.2.4752/src/help.c 2022-03-25 14:54:12.240479311 +0000 --- src/help.c 2022-04-15 13:30:30.777805626 +0100 *************** *** 708,714 **** if (STRCMP(curbuf->b_p_ft, "help") != 0) { ++curbuf_lock; ! set_option_value((char_u *)"ft", 0L, (char_u *)"help", OPT_LOCAL); --curbuf_lock; } --- 708,715 ---- if (STRCMP(curbuf->b_p_ft, "help") != 0) { ++curbuf_lock; ! set_option_value_give_err((char_u *)"ft", ! 0L, (char_u *)"help", OPT_LOCAL); --curbuf_lock; } *** ../vim-8.2.4752/src/highlight.c 2022-04-09 21:02:58.506251763 +0100 --- src/highlight.c 2022-04-15 13:30:47.969783104 +0100 *************** *** 974,981 **** && dark != (*p_bg == 'd') && !option_was_set((char_u *)"bg")) { ! set_option_value((char_u *)"bg", 0L, ! (char_u *)(dark ? "dark" : "light"), 0); reset_option_was_set((char_u *)"bg"); } } --- 974,981 ---- && dark != (*p_bg == 'd') && !option_was_set((char_u *)"bg")) { ! set_option_value_give_err((char_u *)"bg", ! 0L, (char_u *)(dark ? "dark" : "light"), 0); reset_option_was_set((char_u *)"bg"); } } *** ../vim-8.2.4752/src/if_tcl.c 2022-01-17 21:34:33.794266781 +0000 --- src/if_tcl.c 2022-04-15 13:30:58.861768860 +0100 *************** *** 1359,1365 **** sval = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL); if (err == TCL_OK) { ! set_option_value(option, lval, sval, OPT_LOCAL); err = vimerror(interp); } } --- 1359,1365 ---- sval = (char_u *)Tcl_GetStringFromObj(objv[objn], NULL); if (err == TCL_OK) { ! set_option_value_give_err(option, lval, sval, OPT_LOCAL); err = vimerror(interp); } } *** ../vim-8.2.4752/src/main.c 2022-04-12 15:08:36.669207637 +0100 --- src/main.c 2022-04-15 13:32:18.993664516 +0100 *************** *** 2033,2039 **** use_gvimrc = (char_u *)"NONE"; #endif parmp->clean = TRUE; ! set_option_value((char_u *)"vif", 0L, (char_u *)"NONE", 0); } else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0) { --- 2033,2040 ---- use_gvimrc = (char_u *)"NONE"; #endif parmp->clean = TRUE; ! set_option_value_give_err((char_u *)"vif", ! 0L, (char_u *)"NONE", 0); } else if (STRNICMP(argv[0] + argv_idx, "literal", 7) == 0) { *************** *** 2115,2121 **** case 'A': // "-A" start in Arabic mode #ifdef FEAT_ARABIC ! set_option_value((char_u *)"arabic", 1L, NULL, 0); #else mch_errmsg(_(e_arabic_cannot_be_used_not_enabled_at_compile_time)); mch_exit(2); --- 2116,2122 ---- case 'A': // "-A" start in Arabic mode #ifdef FEAT_ARABIC ! set_option_value_give_err((char_u *)"arabic", 1L, NULL, 0); #else mch_errmsg(_(e_arabic_cannot_be_used_not_enabled_at_compile_time)); mch_exit(2); *************** *** 2171,2177 **** case 'H': // "-H" start in Hebrew mode: rl + hkmap set #ifdef FEAT_RIGHTLEFT p_hkmap = TRUE; ! set_option_value((char_u *)"rl", 1L, NULL, 0); #else mch_errmsg(_(e_hebrew_cannot_be_used_not_enabled_at_compile_time)); mch_exit(2); --- 2172,2178 ---- case 'H': // "-H" start in Hebrew mode: rl + hkmap set #ifdef FEAT_RIGHTLEFT p_hkmap = TRUE; ! set_option_value_give_err((char_u *)"rl", 1L, NULL, 0); #else mch_errmsg(_(e_hebrew_cannot_be_used_not_enabled_at_compile_time)); mch_exit(2); *************** *** 2180,2186 **** case 'l': // "-l" lisp mode, 'lisp' and 'showmatch' on #ifdef FEAT_LISP ! set_option_value((char_u *)"lisp", 1L, NULL, 0); p_sm = TRUE; #endif break; --- 2181,2187 ---- case 'l': // "-l" lisp mode, 'lisp' and 'showmatch' on #ifdef FEAT_LISP ! set_option_value_give_err((char_u *)"lisp", 1L, NULL, 0); p_sm = TRUE; #endif break; *************** *** 2316,2323 **** p_verbose = get_number_arg((char_u *)argv[0], &argv_idx, 10); if (argv[0][argv_idx] != NUL) { ! set_option_value((char_u *)"verbosefile", 0L, ! (char_u *)argv[0] + argv_idx, 0); argv_idx = (int)STRLEN(argv[0]); } break; --- 2317,2324 ---- p_verbose = get_number_arg((char_u *)argv[0], &argv_idx, 10); if (argv[0][argv_idx] != NUL) { ! set_option_value_give_err((char_u *)"verbosefile", ! 0L, (char_u *)argv[0] + argv_idx, 0); argv_idx = (int)STRLEN(argv[0]); } break; *************** *** 2334,2340 **** if (vim_isdigit(((char_u *)argv[0])[argv_idx])) { n = get_number_arg((char_u *)argv[0], &argv_idx, 10); ! set_option_value((char_u *)"window", n, NULL, 0); break; } want_argument = TRUE; --- 2335,2341 ---- if (vim_isdigit(((char_u *)argv[0])[argv_idx])) { n = get_number_arg((char_u *)argv[0], &argv_idx, 10); ! set_option_value_give_err((char_u *)"window", n, NULL, 0); break; } want_argument = TRUE; *************** *** 2463,2469 **** #endif case 'i': // "-i {viminfo}" use for viminfo ! set_option_value((char_u *)"vif", 0L, (char_u *)argv[0], 0); break; case 's': // "-s {scriptin}" read from script file --- 2464,2471 ---- #endif case 'i': // "-i {viminfo}" use for viminfo ! set_option_value_give_err((char_u *)"vif", ! 0L, (char_u *)argv[0], 0); break; case 's': // "-s {scriptin}" read from script file *************** *** 2522,2528 **** { argv_idx = 0; n = get_number_arg((char_u *)argv[0], &argv_idx, 10); ! set_option_value((char_u *)"window", n, NULL, 0); argv_idx = -1; break; } --- 2524,2531 ---- { argv_idx = 0; n = get_number_arg((char_u *)argv[0], &argv_idx, 10); ! set_option_value_give_err((char_u *)"window", ! n, NULL, 0); argv_idx = -1; break; } *************** *** 2967,2973 **** p_shm_save = vim_strsave(p_shm); vim_snprintf(buf, 100, "F%s", p_shm); ! set_option_value((char_u *)"shm", 0L, (char_u *)buf, 0); } } else --- 2970,2977 ---- p_shm_save = vim_strsave(p_shm); vim_snprintf(buf, 100, "F%s", p_shm); ! set_option_value_give_err((char_u *)"shm", ! 0L, (char_u *)buf, 0); } } else *************** *** 3016,3022 **** if (p_shm_save != NULL) { ! set_option_value((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); } --- 3020,3026 ---- if (p_shm_save != NULL) { ! set_option_value_give_err((char_u *)"shm", 0L, p_shm_save, 0); vim_free(p_shm_save); } *** ../vim-8.2.4752/src/memline.c 2022-04-07 13:26:30.153944670 +0100 --- src/memline.c 2022-04-15 13:32:37.921639993 +0100 *************** *** 1482,1488 **** set_fileformat(b0_ff - 1, OPT_LOCAL); if (b0_fenc != NULL) { ! set_option_value((char_u *)"fenc", 0L, b0_fenc, OPT_LOCAL); vim_free(b0_fenc); } unchanged(curbuf, TRUE, TRUE); --- 1482,1488 ---- set_fileformat(b0_ff - 1, OPT_LOCAL); if (b0_fenc != NULL) { ! set_option_value_give_err((char_u *)"fenc", 0L, b0_fenc, OPT_LOCAL); vim_free(b0_fenc); } unchanged(curbuf, TRUE, TRUE); *************** *** 1759,1765 **** if (*buf->b_p_key != NUL && STRCMP(curbuf->b_p_key, buf->b_p_key) != 0) { msg_puts(_("Using crypt key from swap file for the text file.\n")); ! set_option_value((char_u *)"key", 0L, buf->b_p_key, OPT_LOCAL); } #endif redraw_curbuf_later(NOT_VALID); --- 1759,1765 ---- if (*buf->b_p_key != NUL && STRCMP(curbuf->b_p_key, buf->b_p_key) != 0) { msg_puts(_("Using crypt key from swap file for the text file.\n")); ! set_option_value_give_err((char_u *)"key", 0L, buf->b_p_key, OPT_LOCAL); } #endif redraw_curbuf_later(NOT_VALID); *** ../vim-8.2.4752/src/message_test.c 2021-05-28 13:11:59.725797039 +0100 --- src/message_test.c 2022-04-15 13:32:58.781613002 +0100 *************** *** 314,326 **** params.argv = argv; common_init(¶ms); ! set_option_value((char_u *)"encoding", 0, (char_u *)"utf-8", 0); init_chartab(); test_trunc_string(); test_trunc_string_mbyte(); test_vim_snprintf(); ! set_option_value((char_u *)"encoding", 0, (char_u *)"latin1", 0); init_chartab(); test_trunc_string(); test_vim_snprintf(); --- 314,326 ---- params.argv = argv; common_init(¶ms); ! set_option_value_give_err((char_u *)"encoding", 0, (char_u *)"utf-8", 0); init_chartab(); test_trunc_string(); test_trunc_string_mbyte(); test_vim_snprintf(); ! set_option_value_give_err((char_u *)"encoding", 0, (char_u *)"latin1", 0); init_chartab(); test_trunc_string(); test_vim_snprintf(); *** ../vim-8.2.4752/src/popupmenu.c 2022-03-31 12:33:56.485701120 +0100 --- src/popupmenu.c 2022-04-15 13:36:03.649087754 +0100 *************** *** 876,889 **** { // Edit a new, empty buffer. Set options for a "wipeout" // buffer. ! set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL); ! set_option_value((char_u *)"bl", 0L, NULL, OPT_LOCAL); ! set_option_value((char_u *)"bt", 0L, ! (char_u *)"nofile", OPT_LOCAL); ! set_option_value((char_u *)"bh", 0L, ! (char_u *)"wipe", OPT_LOCAL); ! set_option_value((char_u *)"diff", 0L, ! NULL, OPT_LOCAL); } } if (res == OK) --- 876,891 ---- { // Edit a new, empty buffer. Set options for a "wipeout" // buffer. ! set_option_value_give_err((char_u *)"swf", ! 0L, NULL, OPT_LOCAL); ! set_option_value_give_err((char_u *)"bl", ! 0L, NULL, OPT_LOCAL); ! set_option_value_give_err((char_u *)"bt", ! 0L, (char_u *)"nofile", OPT_LOCAL); ! set_option_value_give_err((char_u *)"bh", ! 0L, (char_u *)"wipe", OPT_LOCAL); ! set_option_value_give_err((char_u *)"diff", ! 0L, NULL, OPT_LOCAL); } } if (res == OK) *** ../vim-8.2.4752/src/quickfix.c 2022-04-14 20:43:52.638894555 +0100 --- src/quickfix.c 2022-04-15 13:37:14.000606011 +0100 *************** *** 4173,4188 **** qf_set_cwindow_options(void) { // switch off 'swapfile' ! set_option_value((char_u *)"swf", 0L, NULL, OPT_LOCAL); ! set_option_value((char_u *)"bt", 0L, (char_u *)"quickfix", ! OPT_LOCAL); ! set_option_value((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); RESET_BINDING(curwin); #ifdef FEAT_DIFF curwin->w_p_diff = FALSE; #endif #ifdef FEAT_FOLDING ! set_option_value((char_u *)"fdm", 0L, (char_u *)"manual", OPT_LOCAL); #endif } --- 4173,4188 ---- qf_set_cwindow_options(void) { // switch off 'swapfile' ! set_option_value_give_err((char_u *)"swf", 0L, NULL, OPT_LOCAL); ! set_option_value_give_err((char_u *)"bt", ! 0L, (char_u *)"quickfix", OPT_LOCAL); ! set_option_value_give_err((char_u *)"bh", 0L, (char_u *)"hide", OPT_LOCAL); RESET_BINDING(curwin); #ifdef FEAT_DIFF curwin->w_p_diff = FALSE; #endif #ifdef FEAT_FOLDING ! set_option_value_give_err((char_u *)"fdm", 0L, (char_u *)"manual", OPT_LOCAL); #endif } *************** *** 4796,4802 **** // This resembles reading a file into a buffer, it's more logical when // using autocommands. ++curbuf_lock; ! set_option_value((char_u *)"ft", 0L, (char_u *)"qf", OPT_LOCAL); curbuf->b_p_ma = FALSE; keep_filetype = TRUE; // don't detect 'filetype' --- 4796,4803 ---- // This resembles reading a file into a buffer, it's more logical when // using autocommands. ++curbuf_lock; ! set_option_value_give_err((char_u *)"ft", ! 0L, (char_u *)"qf", OPT_LOCAL); curbuf->b_p_ma = FALSE; keep_filetype = TRUE; // don't detect 'filetype' *************** *** 8312,8318 **** // Darn, some plugin changed the value. If it's still empty it was // changed and restored, need to restore in the complicated way. if (*p_cpo == NUL) ! set_option_value((char_u *)"cpo", 0L, save_cpo, 0); if (save_cpo_allocated) free_string_option(save_cpo); } --- 8313,8319 ---- // Darn, some plugin changed the value. If it's still empty it was // changed and restored, need to restore in the complicated way. if (*p_cpo == NUL) ! set_option_value_give_err((char_u *)"cpo", 0L, save_cpo, 0); if (save_cpo_allocated) free_string_option(save_cpo); } *** ../vim-8.2.4752/src/scriptfile.c 2022-04-14 15:39:39.281754582 +0100 --- src/scriptfile.c 2022-04-15 13:37:33.032483536 +0100 *************** *** 783,789 **** STRCAT(new_rtp, afterdir); } ! set_option_value((char_u *)"rtp", 0L, new_rtp, 0); vim_free(new_rtp); retval = OK; --- 783,789 ---- STRCAT(new_rtp, afterdir); } ! set_option_value_give_err((char_u *)"rtp", 0L, new_rtp, 0); vim_free(new_rtp); retval = OK; *************** *** 1758,1764 **** } } } ! set_option_value((char_u *)"cpo", 0L, si->sn_save_cpo, OPT_NO_REDRAW); } VIM_CLEAR(si->sn_save_cpo); --- 1758,1765 ---- } } } ! set_option_value_give_err((char_u *)"cpo", ! 0L, si->sn_save_cpo, OPT_NO_REDRAW); } VIM_CLEAR(si->sn_save_cpo); *** ../vim-8.2.4752/src/spell.c 2022-03-22 20:42:09.174172862 +0000 --- src/spell.c 2022-04-15 13:42:26.374928333 +0100 *************** *** 1965,1971 **** /* * Parse 'spelllang' and set w_s->b_langp accordingly. ! * Returns NULL if it's OK, an error message otherwise. */ char * did_set_spelllang(win_T *wp) --- 1965,1971 ---- /* * Parse 'spelllang' and set w_s->b_langp accordingly. ! * Returns NULL if it's OK, an untranslated error message otherwise. */ char * did_set_spelllang(win_T *wp) *************** *** 3834,3841 **** do_cmdline_cmd((char_u *)"new"); // enable spelling locally in the new window ! set_option_value((char_u*)"spell", TRUE, (char_u*)"", OPT_LOCAL); ! set_option_value((char_u*)"spl", dummy, spl, OPT_LOCAL); vim_free(spl); if (!BUFEMPTY()) --- 3834,3841 ---- do_cmdline_cmd((char_u *)"new"); // enable spelling locally in the new window ! set_option_value_give_err((char_u*)"spell", TRUE, (char_u*)"", OPT_LOCAL); ! set_option_value_give_err((char_u*)"spl", dummy, spl, OPT_LOCAL); vim_free(spl); if (!BUFEMPTY()) *** ../vim-8.2.4752/src/spellfile.c 2022-03-31 11:37:54.263367943 +0100 --- src/spellfile.c 2022-04-15 13:37:55.672341910 +0100 *************** *** 6414,6420 **** fname != NULL && strstr((char *)gettail(fname), ".ascii.") != NULL ? (char_u *)"ascii" : spell_enc()); ! set_option_value((char_u *)"spellfile", 0L, buf, OPT_LOCAL); break; } aspath = FALSE; --- 6414,6421 ---- fname != NULL && strstr((char *)gettail(fname), ".ascii.") != NULL ? (char_u *)"ascii" : spell_enc()); ! set_option_value_give_err((char_u *)"spellfile", ! 0L, buf, OPT_LOCAL); break; } aspath = FALSE; *** ../vim-8.2.4752/src/term.c 2022-04-14 21:36:09.547209667 +0100 --- src/term.c 2022-04-15 13:38:47.940030710 +0100 *************** *** 2029,2035 **** # endif if (p != NULL) { ! set_option_value((char_u *)"ttym", 0L, p, 0); // Reset the WAS_SET flag, 'ttymouse' can be set to "sgr" or // "xterm2" in check_termcode(). reset_option_was_set((char_u *)"ttym"); --- 2029,2035 ---- # endif if (p != NULL) { ! set_option_value_give_err((char_u *)"ttym", 0L, p, 0); // Reset the WAS_SET flag, 'ttymouse' can be set to "sgr" or // "xterm2" in check_termcode(). reset_option_was_set((char_u *)"ttym"); *************** *** 4605,4611 **** // Setting the option causes a screen redraw. Do // that right away if possible, keeping any // messages. ! set_option_value((char_u *)"ambw", 0L, (char_u *)aw, 0); # ifdef DEBUG_TERMRESPONSE { int r = redraw_asap(CLEAR); --- 4605,4611 ---- // Setting the option causes a screen redraw. Do // that right away if possible, keeping any // messages. ! set_option_value_give_err((char_u *)"ambw", 0L, (char_u *)aw, 0); # ifdef DEBUG_TERMRESPONSE { int r = redraw_asap(CLEAR); *************** *** 4816,4822 **** && (term_props[TPR_MOUSE].tpr_status == TPR_MOUSE_XTERM2 || term_props[TPR_MOUSE].tpr_status == TPR_MOUSE_SGR)) { ! set_option_value((char_u *)"ttym", 0L, term_props[TPR_MOUSE].tpr_status == TPR_MOUSE_SGR ? (char_u *)"sgr" : (char_u *)"xterm2", 0); } --- 4816,4822 ---- && (term_props[TPR_MOUSE].tpr_status == TPR_MOUSE_XTERM2 || term_props[TPR_MOUSE].tpr_status == TPR_MOUSE_SGR)) { ! set_option_value_give_err((char_u *)"ttym", 0L, term_props[TPR_MOUSE].tpr_status == TPR_MOUSE_SGR ? (char_u *)"sgr" : (char_u *)"xterm2", 0); } *************** *** 5140,5147 **** && STRCMP(p_bg, new_bg_val) != 0) { // value differs, apply it ! set_option_value((char_u *)"bg", 0L, ! (char_u *)new_bg_val, 0); reset_option_was_set((char_u *)"bg"); redraw_asap(CLEAR); } --- 5140,5147 ---- && STRCMP(p_bg, new_bg_val) != 0) { // value differs, apply it ! set_option_value_give_err((char_u *)"bg", ! 0L, (char_u *)new_bg_val, 0); reset_option_was_set((char_u *)"bg"); redraw_asap(CLEAR); } *** ../vim-8.2.4752/src/undo.c 2022-02-14 14:50:44.529919531 +0000 --- src/undo.c 2022-04-15 13:39:01.683952332 +0100 *************** *** 3693,3699 **** vim_free(file_name); } ! set_option_value((char_u *)"undofile", 0L, NULL, OPT_LOCAL); } #endif --- 3693,3699 ---- vim_free(file_name); } ! set_option_value_give_err((char_u *)"undofile", 0L, NULL, OPT_LOCAL); } #endif *** ../vim-8.2.4752/src/vim9script.c 2022-04-05 21:40:32.107458262 +0100 --- src/vim9script.c 2022-04-15 13:39:22.103838391 +0100 *************** *** 136,142 **** if (STRCMP(p_cpo, CPO_VIM) != 0) { si->sn_save_cpo = vim_strsave(p_cpo); ! set_option_value((char_u *)"cpo", 0L, (char_u *)CPO_VIM, OPT_NO_REDRAW); } #else // No check for this being the first command, it doesn't matter. --- 136,143 ---- if (STRCMP(p_cpo, CPO_VIM) != 0) { si->sn_save_cpo = vim_strsave(p_cpo); ! set_option_value_give_err((char_u *)"cpo", ! 0L, (char_u *)CPO_VIM, OPT_NO_REDRAW); } #else // No check for this being the first command, it doesn't matter. *** ../vim-8.2.4752/src/version.c 2022-04-15 13:17:54.386867455 +0100 --- src/version.c 2022-04-15 13:52:48.820818400 +0100 *************** *** 748,749 **** --- 748,751 ---- { /* Add new patch number below this line */ + /**/ + 4753, /**/ -- Female engineers become irresistible at the age of consent and remain that way until about thirty minutes after their clinical death. Longer if it's a warm day. (Scott Adams - The Dilbert principle) /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// \\\ \\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///