Ben Fritz wrote:

On Jan 9, 10:46 am, Charles Campbell<[email protected]>
wrote:
The problem you've had with your syntax highlighting is one with
priority and sequentiality:

* With the following sequence, the has already been taken up

syntax match Conceal / \| / conceal
syntax match sExamplesInText / \zs[^ ]\_.\{-}\ze /

   by the sExamplesInText, as it has priority due to appearing later (sequence), so 
"Conceal" never sees it (assuming balanced ... delimiters so that 
sExamplesInText matches).

* With the following sequence, the has already been taken up

syntax match sExamplesInText / \zs[^ ]\_.\{-}\ze /
syntax match Conceal / \| / conceal

   by the "Conceal", as it has priority due to appearing later (sequence); this 
time, sExamplesInText never sees the character and so never matches.

I thought in the second ordering, the \zs and \ze in the first rule
allowed the second rule to match. Is this not the case? Maybe just
using stuff described in :he :syn-pattern-offset instead of \zs and
\ze will allow this to work as expected?

A rule of syntax highlighting: the syntax highlighting engine doesn't look back. Applied to this case, the Conceal group has, due to sequencing priority, "eaten" the « character. Trying this with the Conceal group absent shows what the \zs does visually: the «is not highlighted, but the subsequent text is.

The first rule set seems to me more like it "should work", actually, than the second. Syntax highlighting is tricky.

Regards,
Chip

--
You received this message from the "vim_use" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

Reply via email to