mirror of
https://github.com/vim/vim.git
synced 2025-09-28 04:24:06 -04:00
patch 9.0.0176: checking character options is duplicated and incomplete
Problem: Checking character options is duplicated and incomplete. Solution: Move checking to check_chars_options(). (closes #10863)
This commit is contained in:
25
src/screen.c
25
src/screen.c
@@ -5155,3 +5155,28 @@ set_chars_option(win_T *wp, char_u **varp, int apply)
|
||||
|
||||
return NULL; // no error
|
||||
}
|
||||
|
||||
/*
|
||||
* Check all global and local values of 'listchars' and 'fillchars'.
|
||||
* Return an untranslated error messages if any of them is invalid, NULL
|
||||
* otherwise.
|
||||
*/
|
||||
char *
|
||||
check_chars_options(void)
|
||||
{
|
||||
tabpage_T *tp;
|
||||
win_T *wp;
|
||||
|
||||
if (set_chars_option(curwin, &p_lcs, FALSE) != NULL)
|
||||
return e_conflicts_with_value_of_listchars;
|
||||
if (set_chars_option(curwin, &p_fcs, FALSE) != NULL)
|
||||
return e_conflicts_with_value_of_fillchars;
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp)
|
||||
{
|
||||
if (set_chars_option(wp, &wp->w_p_lcs, FALSE) != NULL)
|
||||
return e_conflicts_with_value_of_listchars;
|
||||
if (set_chars_option(wp, &wp->w_p_fcs, FALSE) != NULL)
|
||||
return e_conflicts_with_value_of_fillchars;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
Reference in New Issue
Block a user