0
0
mirror of https://github.com/vim/vim.git synced 2025-09-29 04:34:16 -04:00

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.
This commit is contained in:
Bram Moolenaar
2022-07-04 21:03:36 +01:00
parent 4c99e622dd
commit b67f0c8e49
6 changed files with 66 additions and 61 deletions

View File

@@ -5647,9 +5647,9 @@ f_setcellwidths(typval_T *argvars, typval_T *rettv UNUSED)
// Check that the new value does not conflict with 'fillchars' or
// 'listchars'.
if (set_chars_option(curwin, &p_fcs) != NULL)
if (set_chars_option(curwin, &p_fcs, FALSE) != NULL)
error = e_conflicts_with_value_of_fillchars;
else if (set_chars_option(curwin, &p_lcs) != NULL)
else if (set_chars_option(curwin, &p_lcs, FALSE) != NULL)
error = e_conflicts_with_value_of_listchars;
else
{
@@ -5658,12 +5658,12 @@ f_setcellwidths(typval_T *argvars, typval_T *rettv UNUSED)
FOR_ALL_TAB_WINDOWS(tp, wp)
{
if (set_chars_option(wp, &wp->w_p_lcs) != NULL)
if (set_chars_option(wp, &wp->w_p_lcs, FALSE) != NULL)
{
error = e_conflicts_with_value_of_listchars;
break;
}
if (set_chars_option(wp, &wp->w_p_fcs) != NULL)
if (set_chars_option(wp, &wp->w_p_fcs, FALSE) != NULL)
{
error = e_conflicts_with_value_of_fillchars;
break;