mirror of
https://github.com/neovim/neovim.git
synced 2025-09-28 14:08:32 +00:00
vim-patch:9.0.0176: checking character options is duplicated and incomplete (#19690)
Problem: Checking character options is duplicated and incomplete.
Solution: Move checking to check_chars_options(). (closes vim/vim#10863)
8ca29b6a35
This commit is contained in:
@@ -2844,25 +2844,9 @@ void f_setcellwidths(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||
cw_table = table;
|
||||
cw_table_size = (size_t)tv_list_len(l);
|
||||
|
||||
// Check that the new value does not conflict with 'fillchars' or
|
||||
// 'listchars'.
|
||||
char *error = 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, false) != NULL) {
|
||||
error = e_conflicts_with_value_of_listchars;
|
||||
} else {
|
||||
FOR_ALL_TAB_WINDOWS(tp, wp) {
|
||||
if (set_chars_option(wp, &wp->w_p_lcs, true) != NULL) {
|
||||
error = e_conflicts_with_value_of_listchars;
|
||||
break;
|
||||
}
|
||||
if (set_chars_option(wp, &wp->w_p_fcs, true) != NULL) {
|
||||
error = e_conflicts_with_value_of_fillchars;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Check that the new value does not conflict with 'listchars' or
|
||||
// 'fillchars'.
|
||||
const char *const error = check_chars_options();
|
||||
if (error != NULL) {
|
||||
emsg(_(error));
|
||||
cw_table = cw_table_save;
|
||||
|
Reference in New Issue
Block a user