patch 9.0.0036: 'fillchars' cannot have window-local values
Problem: 'fillchars' cannot have window-local values.
Solution: Make 'fillchars' global-local. (closes #5206)
diff --git a/src/optionstr.c b/src/optionstr.c
index c26667a..43b7e50 100644
--- a/src/optionstr.c
+++ b/src/optionstr.c
@@ -1311,7 +1311,7 @@
if (errmsg == NULL)
{
tabpage_T *tp;
- win_T *wp;
+ win_T *wp;
// The current window is set to use the global 'listchars' value.
// So clear the window-local value.
@@ -1320,12 +1320,12 @@
FOR_ALL_TAB_WINDOWS(tp, wp)
// If no error was returned above, we don't expect an error
// here, so ignore the return value.
- (void)set_chars_option(wp, &wp->w_p_lcs);
+ if (*wp->w_p_lcs == NUL)
+ (void)set_chars_option(wp, &wp->w_p_lcs);
redraw_all_later(NOT_VALID);
}
}
-
// local 'listchars'
else if (varp == &curwin->w_p_lcs)
errmsg = set_chars_option(curwin, varp);
@@ -1334,6 +1334,28 @@
else if (varp == &p_fcs)
{
errmsg = set_chars_option(curwin, varp);
+ if (errmsg == NULL)
+ {
+ tabpage_T *tp;
+ win_T *wp;
+
+ // The current window is set to use the global 'fillchars' value.
+ // So clear the window-local value.
+ if (!(opt_flags & OPT_GLOBAL))
+ clear_string_option(&curwin->w_p_fcs);
+ FOR_ALL_TAB_WINDOWS(tp, wp)
+ // If no error was returned above, we don't expect an error
+ // here, so ignore the return value.
+ if (*wp->w_p_fcs == NUL)
+ (void)set_chars_option(wp, &wp->w_p_fcs);
+
+ redraw_all_later(NOT_VALID);
+ }
+ }
+ // local 'fillchars'
+ else if (varp == &curwin->w_p_fcs)
+ {
+ errmsg = set_chars_option(curwin, varp);
}
#ifdef FEAT_CMDWIN