diff options
author | zeertzjq <zeertzjq@outlook.com> | 2023-05-08 23:29:02 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-05-08 23:29:02 +0800 |
commit | 7ed4274f6978ecf610caa9c8a4b082cb3b643143 (patch) | |
tree | 912847955391e71427efb09a1687db22b4fdc5c0 | |
parent | 88366641ad8a11bd428a91b9b294fe53ef1a71b7 (diff) | |
download | rneovim-7ed4274f6978ecf610caa9c8a4b082cb3b643143.tar.gz rneovim-7ed4274f6978ecf610caa9c8a4b082cb3b643143.tar.bz2 rneovim-7ed4274f6978ecf610caa9c8a4b082cb3b643143.zip |
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
-rw-r--r-- | src/nvim/optionstr.c | 12 |
1 files changed, 6 insertions, 6 deletions
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 } } |