diff options
author | Bram Moolenaar <Bram@vim.org> | 2022-07-04 17:34:33 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2022-07-04 17:34:33 +0100 |
commit | 96ba25ac01279f73c0ecb5d4aa4ff37aa359e5eb (patch) | |
tree | a7ebf066dede8010563debf70816231c4cdf75f4 /src/optionstr.c | |
parent | 54e5fed6d27b747ff152cdb6edfb72ff60e70939 (diff) | |
download | vim-git-96ba25ac01279f73c0ecb5d4aa4ff37aa359e5eb.tar.gz |
patch 9.0.0036: 'fillchars' cannot have window-local valuesv9.0.0036
Problem: 'fillchars' cannot have window-local values.
Solution: Make 'fillchars' global-local. (closes #5206)
Diffstat (limited to 'src/optionstr.c')
-rw-r--r-- | src/optionstr.c | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/optionstr.c b/src/optionstr.c index c26667a2b..43b7e5097 100644 --- a/src/optionstr.c +++ b/src/optionstr.c @@ -1311,7 +1311,7 @@ ambw_end: 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 @@ ambw_end: 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 @@ ambw_end: 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 |