diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-08-09 20:35:34 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-08-09 20:35:34 +0800 |
commit | 24bf0490ea3a16c14494358fe45437e43ca8d1d1 (patch) | |
tree | 31c21d2cbc273a1a1586ab0b05ddf78c21ef40a6 /src/nvim/mbyte.c | |
parent | 33ddca6fa0534df2605699070fdd1e5c6e4a7bcf (diff) | |
download | rneovim-24bf0490ea3a16c14494358fe45437e43ca8d1d1.tar.gz rneovim-24bf0490ea3a16c14494358fe45437e43ca8d1d1.tar.bz2 rneovim-24bf0490ea3a16c14494358fe45437e43ca8d1d1.zip |
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)
https://github.com/vim/vim/commit/8ca29b6a3599b82b8822b7697cad63d0244c2d59
Diffstat (limited to 'src/nvim/mbyte.c')
-rw-r--r-- | src/nvim/mbyte.c | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/src/nvim/mbyte.c b/src/nvim/mbyte.c index e156fa58d1..8e8cf962c7 100644 --- a/src/nvim/mbyte.c +++ b/src/nvim/mbyte.c @@ -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; |