diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-11-21 22:21:32 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-11-21 22:21:32 -0500 |
commit | 64abd7be7993ed3fa031b5d71a4482871108093a (patch) | |
tree | 447c4e3066a20c50b5fc060c6e9236045f3669b0 /src/nvim/option.c | |
parent | e05db65d2ae3bb3c57e009e67ffc85794835a4e2 (diff) | |
parent | 145fc69df9f173717e3138c0a07a8de1a243519a (diff) | |
download | rneovim-nightly.tar.gz rneovim-nightly.tar.bz2 rneovim-nightly.zip |
Merge pull request #16341 from zeertzjq/vim-8.2.2518nightly
vim-patch:8.2.{2518,2520,3572,3588}: 'listchars' (and 'fillchars'?) fixes
Diffstat (limited to 'src/nvim/option.c')
-rw-r--r-- | src/nvim/option.c | 30 |
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' |