diff options
author | Yegappan Lakshmanan <yegappan@yahoo.com> | 2023-02-13 16:10:04 +0000 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2023-02-13 16:10:04 +0000 |
commit | 32ff96ef018eb1a5bea0953648b4892a6ee71658 (patch) | |
tree | c3a1a5383526dccb92ce5b9289f0a8f42c0f748b /src/optionstr.c | |
parent | 5ceb8157bc4608eeff4b7453da31ebe65f08a862 (diff) |
patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errorsv9.0.1307
Problem: Setting 'formatoptions' with :let doesn't check for errors.
Solution: Pass "errbuf" to set_string_option(). (Yegappan Lakshmanan,
closes #11974, closes #11972)
Diffstat (limited to 'src/optionstr.c')
-rw-r--r-- | src/optionstr.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/optionstr.c b/src/optionstr.c index 7dfb7b7ff5..6c9fd3ab32 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -487,7 +487,8 @@ set_string_option_direct_in_buf( set_string_option( int opt_idx, char_u *value, - int opt_flags) // OPT_LOCAL and/or OPT_GLOBAL + int opt_flags, // OPT_LOCAL and/or OPT_GLOBAL + char *errbuf) { char_u *s; char_u **varp; @@ -540,7 +541,7 @@ set_string_option( saved_newval = vim_strsave(s); } #endif - if ((errmsg = did_set_string_option(opt_idx, varp, oldval, NULL, + if ((errmsg = did_set_string_option(opt_idx, varp, oldval, errbuf, opt_flags, &value_checked)) == NULL) did_set_option(opt_idx, opt_flags, TRUE, value_checked); |