aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/optionstr.c
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2022-08-26 09:03:45 +0800
committerzeertzjq <zeertzjq@outlook.com>2022-08-26 10:14:59 +0800
commit752d397cae994e496cbfaad386f39d24d7fa8203 (patch)
tree31c17134c16cbdac9335f4d7e144f2d4d1de51e7 /src/nvim/optionstr.c
parentfa1c761d62667c28e4d3a81f379abeddb878f3cd (diff)
downloadrneovim-752d397cae994e496cbfaad386f39d24d7fa8203.tar.gz
rneovim-752d397cae994e496cbfaad386f39d24d7fa8203.tar.bz2
rneovim-752d397cae994e496cbfaad386f39d24d7fa8203.zip
vim-patch:9.0.0038: 'listchars' test fails
Problem: 'listchars' test fails. Solution: Use window-local value after setting the global value https://github.com/vim/vim/commit/5ed26faace574f6b36744f9e17075d7e806aa877
Diffstat (limited to 'src/nvim/optionstr.c')
-rw-r--r--src/nvim/optionstr.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c
index e6847c3ea5..604fc54f7c 100644
--- a/src/nvim/optionstr.c
+++ b/src/nvim/optionstr.c
@@ -952,17 +952,17 @@ char *did_set_string_option(int opt_idx, char_u **varp, char_u *oldval, char *er
} else if (varp == &p_lcs) { // global 'listchars'
errmsg = set_chars_option(curwin, varp, false);
if (errmsg == NULL) {
- // The current window is set to use the global 'listchars' value.
- // So clear the window-local value.
+ // If the current window is set to use the global 'listchars'
+ // value, clear the window-local value.
if (!(opt_flags & OPT_GLOBAL)) {
clear_string_option(&curwin->w_p_lcs);
}
FOR_ALL_TAB_WINDOWS(tp, wp) {
+ // If the current window has a local value need to apply it
+ // again, it was changed when setting the global value.
// If no error was returned above, we don't expect an error
// here, so ignore the return value.
- if (*wp->w_p_lcs == NUL) {
- (void)set_chars_option(wp, (char_u **)&wp->w_p_lcs, true);
- }
+ (void)set_chars_option(wp, (char_u **)&wp->w_p_lcs, true);
}
redraw_all_later(UPD_NOT_VALID);
}
@@ -971,17 +971,17 @@ char *did_set_string_option(int opt_idx, char_u **varp, char_u *oldval, char *er
} else if (varp == &p_fcs) { // global 'fillchars'
errmsg = set_chars_option(curwin, varp, false);
if (errmsg == NULL) {
- // The current window is set to use the global 'fillchars' value.
- // So clear the window-local value.
+ // If the current window is set to use the global 'fillchars'
+ // value clear the window-local value.
if (!(opt_flags & OPT_GLOBAL)) {
clear_string_option(&curwin->w_p_fcs);
}
FOR_ALL_TAB_WINDOWS(tp, wp) {
+ // If the current window has a local value need to apply it
+ // again, it was changed when setting the global value.
// 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, (char_u **)&wp->w_p_fcs, true);
- }
+ (void)set_chars_option(wp, (char_u **)&wp->w_p_fcs, true);
}
redraw_all_later(UPD_NOT_VALID);
}