patch 9.0.0040: use of set_chars_option() is confusing
Problem: Use of set_chars_option() is confusing.
Solution: Add "apply" argument to store the result or not. Merge similar
code.
diff --git a/src/option.c b/src/option.c
index dd4ed1b..1b4b9da 100644
--- a/src/option.c
+++ b/src/option.c
@@ -2433,10 +2433,10 @@
check_opt_wim();
// Parse default for 'listchars'.
- (void)set_chars_option(curwin, &curwin->w_p_lcs);
+ (void)set_chars_option(curwin, &curwin->w_p_lcs, TRUE);
// Parse default for 'fillchars'.
- (void)set_chars_option(curwin, &curwin->w_p_fcs);
+ (void)set_chars_option(curwin, &curwin->w_p_fcs, TRUE);
#ifdef FEAT_CLIPBOARD
// Parse default for 'clipboard'
@@ -5204,12 +5204,12 @@
break;
case PV_LCS:
clear_string_option(&((win_T *)from)->w_p_lcs);
- set_chars_option((win_T *)from, &((win_T *)from)->w_p_lcs);
+ set_chars_option((win_T *)from, &((win_T *)from)->w_p_lcs, TRUE);
redraw_later(NOT_VALID);
break;
case PV_FCS:
clear_string_option(&((win_T *)from)->w_p_fcs);
- set_chars_option((win_T *)from, &((win_T *)from)->w_p_fcs);
+ set_chars_option((win_T *)from, &((win_T *)from)->w_p_fcs, TRUE);
redraw_later(NOT_VALID);
break;
case PV_VE:
@@ -5607,8 +5607,8 @@
fill_culopt_flags(NULL, wp);
check_colorcolumn(wp);
#endif
- set_chars_option(wp, &wp->w_p_lcs);
- set_chars_option(wp, &wp->w_p_fcs);
+ set_chars_option(wp, &wp->w_p_lcs, TRUE);
+ set_chars_option(wp, &wp->w_p_fcs, TRUE);
}
static char_u *