patch 9.0.1307: setting 'formatoptions' with :let doesn't check for errors
Problem: Setting 'formatoptions' with :let doesn't check for errors.
Solution: Pass "errbuf" to set_string_option(). (Yegappan Lakshmanan,
closes #11974, closes #11972)
diff --git a/src/optionstr.c b/src/optionstr.c
index 7dfb7b7..6c9fd3a 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -487,7 +487,8 @@
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 @@
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);