summaryrefslogtreecommitdiff
path: root/src/screen.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2016-04-14 19:50:22 +0200
committerBram Moolenaar <Bram@vim.org>2016-04-14 19:50:22 +0200
commit4d585022023b96f6507e8cae5ed8fc8d926f5140 (patch)
tree044b644685ba3034bcaee0f022aaf8fd70a8fc64 /src/screen.c
parentbea1ede1c59a11ca5bf9d91cd30b7b2937b9fb41 (diff)
downloadvim-git-4d585022023b96f6507e8cae5ed8fc8d926f5140.tar.gz
patch 7.4.1740v7.4.1740
Problem: syn-cchar defined with matchadd() does not appear if there are no other syntax definitions which matches buffer text. Solution: Check for startcol. (Ozaki Kiichi, haya14busa, closes #757)
Diffstat (limited to 'src/screen.c')
-rw-r--r--src/screen.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/src/screen.c b/src/screen.c
index 8044079b5..b92cbf9e2 100644
--- a/src/screen.c
+++ b/src/screen.c
@@ -3057,8 +3057,8 @@ win_line(
wrapping */
int vcol_off = 0; /* offset for concealed characters */
int did_wcol = FALSE;
- int match_conc = FALSE; /* cchar for match functions */
- int has_match_conc = FALSE; /* match wants to conceal */
+ int match_conc = 0; /* cchar for match functions */
+ int has_match_conc = 0; /* match wants to conceal */
int old_boguscols = 0;
# define VCOL_HLC (vcol - vcol_off)
# define FIX_FOR_BOGUSCOLS \
@@ -3595,7 +3595,7 @@ win_line(
for (;;)
{
#ifdef FEAT_CONCEAL
- has_match_conc = FALSE;
+ has_match_conc = 0;
#endif
/* Skip this quickly when working on the text. */
if (draw_state != WL_LINE)
@@ -3944,11 +3944,12 @@ win_line(
if (cur != NULL && syn_name2id((char_u *)"Conceal")
== cur->hlg_id)
{
- has_match_conc = TRUE;
+ has_match_conc =
+ v == (long)shl->startcol ? 2 : 1;
match_conc = cur->conceal_char;
}
else
- has_match_conc = match_conc = FALSE;
+ has_match_conc = match_conc = 0;
#endif
}
else if (v == (long)shl->endcol)
@@ -4905,12 +4906,12 @@ win_line(
if ( wp->w_p_cole > 0
&& (wp != curwin || lnum != wp->w_cursor.lnum ||
conceal_cursor_line(wp) )
- && ( (syntax_flags & HL_CONCEAL) != 0 || has_match_conc)
+ && ( (syntax_flags & HL_CONCEAL) != 0 || has_match_conc > 0)
&& !(lnum_in_visual_area
&& vim_strchr(wp->w_p_cocu, 'v') == NULL))
{
char_attr = conceal_attr;
- if (prev_syntax_id != syntax_seqnr
+ if ((prev_syntax_id != syntax_seqnr || has_match_conc > 1)
&& (syn_get_sub_char() != NUL || match_conc
|| wp->w_p_cole == 1)
&& wp->w_p_cole != 3)