From 7ed4274f6978ecf610caa9c8a4b082cb3b643143 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Mon, 8 May 2023 23:29:02 +0800 Subject: vim-patch:9.0.1526: condition is always true (#23541) Problem: Condition is always true. Solution: Remove unnecessary condition. (closes vim/vim#12359) https://github.com/vim/vim/commit/d619d6a9c6fa0e4295c817a88f84f0bab9457bbe --- src/nvim/optionstr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/nvim/optionstr.c b/src/nvim/optionstr.c index 1c75d5bd03..d3f676379d 100644 --- a/src/nvim/optionstr.c +++ b/src/nvim/optionstr.c @@ -2301,17 +2301,17 @@ static int get_encoded_char_adv(const char **p) /// Handle setting 'listchars' or 'fillchars'. /// Assume monocell characters /// -/// @param value points to either the global or the window-local value. -/// @param opt_lcs is tue for "listchars" and FALSE for "fillchars". +/// @param value points to either the global or the window-local value. +/// @param is_listchars is true for "listchars" and false for "fillchars". /// @param apply if false, do not store the flags, only check for errors. /// @return error message, NULL if it's OK. -static const char *set_chars_option(win_T *wp, const char *value, bool opt_lcs, bool apply) +static const char *set_chars_option(win_T *wp, const char *value, const bool is_listchars, + const bool apply) { const char *last_multispace = NULL; // Last occurrence of "multispace:" const char *last_lmultispace = NULL; // Last occurrence of "leadmultispace:" int multispace_len = 0; // Length of lcs-multispace string int lead_multispace_len = 0; // Length of lcs-leadmultispace string - const bool is_listchars = opt_lcs; struct chars_tab { int *cp; ///< char value @@ -2358,13 +2358,13 @@ static const char *set_chars_option(win_T *wp, const char *value, bool opt_lcs, if (is_listchars) { tab = lcs_tab; entries = ARRAY_SIZE(lcs_tab); - if (opt_lcs && wp->w_p_lcs[0] == NUL) { + if (wp->w_p_lcs[0] == NUL) { value = p_lcs; // local value is empty, use the global value } } else { tab = fcs_tab; entries = ARRAY_SIZE(fcs_tab); - if (!opt_lcs && wp->w_p_fcs[0] == NUL) { + if (wp->w_p_fcs[0] == NUL) { value = p_fcs; // local value is empty, use the global value } } -- cgit