aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r--src/nvim/option.c30
1 files changed, 22 insertions, 8 deletions
diff --git a/src/nvim/option.c b/src/nvim/option.c
index 44b7d98e88..45e2032b35 100644
--- a/src/nvim/option.c
+++ b/src/nvim/option.c
@@ -2650,24 +2650,38 @@ ambw_end:
}
s = skip_to_option_part(s);
}
- } else if (varp == &p_lcs) { // 'listchars'
+ } else if (varp == &p_lcs) { // global 'listchars'
errmsg = set_chars_option(curwin, varp, false);
- if (!errmsg) {
+ if (errmsg == NULL) {
+ // The current window is set to use the global 'listchars' value.
+ // So clear the window-local value.
+ if (!(opt_flags & OPT_GLOBAL)) {
+ clear_string_option(&curwin->w_p_lcs);
+ }
FOR_ALL_TAB_WINDOWS(tp, wp) {
- set_chars_option(wp, &wp->w_p_lcs, true);
+ // 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, true);
}
+ redraw_all_later(NOT_VALID);
}
- redraw_all_later(NOT_VALID);
} else if (varp == &curwin->w_p_lcs) { // local 'listchars'
errmsg = set_chars_option(curwin, varp, true);
- } else if (varp == &p_fcs) { // 'fillchars'
+ } else if (varp == &p_fcs) { // global 'fillchars'
errmsg = set_chars_option(curwin, varp, false);
- if (!errmsg) {
+ if (errmsg == NULL) {
+ // 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) {
- set_chars_option(wp, &wp->w_p_fcs, true);
+ // 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_fcs, true);
}
+ redraw_all_later(NOT_VALID);
}
- redraw_all_later(NOT_VALID);
} else if (varp == &curwin->w_p_fcs) { // local 'fillchars'
errmsg = set_chars_option(curwin, varp, true);
} else if (varp == &p_cedit) { // 'cedit'