Skip to content

Commit

Permalink
Fix 'conceal' by matchadd() when :syn off
Browse files Browse the repository at this point in the history
To be precise, when there are no text which matches syntax
definition in current buffer.
  • Loading branch information
haya14busa committed Apr 9, 2016
1 parent 6550979 commit fd3b7a0
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/screen.c
Original file line number Diff line number Diff line change
Expand Up @@ -4910,7 +4910,18 @@ win_line(
&& vim_strchr(wp->w_p_cocu, 'v') == NULL))
{
char_attr = conceal_attr;
if (prev_syntax_id != syntax_seqnr
/* PROBLEM: When trying to show cchar by matchadd(),
* prev_syntax_id and syntax_seqnr might be 0 with :syntax off.
* When trying to show cchar by :syntax match, it's no problem because
* syntax_seqnr is not 0.
* To support showing cchar by matchadd(), change syntax_seqnr
* value to non-zero.
* XXX: better solution?
**/
if (has_match_conc && syntax_seqnr == 0)
syntax_seqnr = -1;

if ((prev_syntax_id != syntax_seqnr)
&& (syn_get_sub_char() != NUL || match_conc
|| wp->w_p_cole == 1)
&& wp->w_p_cole != 3)
Expand Down

0 comments on commit fd3b7a0

Please sign in to comment.