patch 8.2.1056: wrong display when mixing match conceal and syntax conceal
Problem: Wrong display when mixing match conceal and syntax conceal.
Solution: Adjust how conceal flags are used. (closes #6327, closes #6303)
diff --git a/src/drawline.c b/src/drawline.c
index 6d14bda..fad0645 100644
--- a/src/drawline.c
+++ b/src/drawline.c
@@ -967,7 +967,7 @@
for (;;)
{
#if defined(FEAT_CONCEAL) || defined(FEAT_SEARCH_EXTRA)
- int has_match_conc = 0; // match wants to conceal
+ int has_match_conc = 0; // match wants to conceal
#endif
#ifdef FEAT_CONCEAL
int did_decrement_ptr = FALSE;
@@ -2353,13 +2353,14 @@
{
char_attr = conceal_attr;
if ((prev_syntax_id != syntax_seqnr || has_match_conc > 1)
- && (syn_get_sub_char() != NUL || match_conc
- || wp->w_p_cole == 1)
+ && (syn_get_sub_char() != NUL
+ || (has_match_conc && match_conc)
+ || wp->w_p_cole == 1)
&& wp->w_p_cole != 3)
{
// First time at this concealed item: display one
// character.
- if (match_conc)
+ if (has_match_conc && match_conc)
c = match_conc;
else if (syn_get_sub_char() != NUL)
c = syn_get_sub_char();