Thursday, February 25, 2010

Re: Trouble with syntax pattern offset

On Wed, Feb 3, 2010 at 5:14 PM, Vitor Eiji Justus Sakaguti
<vitoreiji0@gmail.com> wrote:
> This works fine for the SQL code, but I dont want the tags themselves
> being highlighted as SQL, so I tried using offsets, but I can't seem
> to get it working, whenever I use ms or me, the SQL is not highlighted
> at all, and rs, re, hs and he make no difference whatsoever, no matter
> what value I set (eg e+1, s-1 etc)

OK, small follow up here.

I found out about \zs and \ze and tried them in my patterns, but I
could only get the closing tag to be colored as XML, but not the
opening one.

That is, the following line works as expected, highlights the closing tag as XML
syntax region sqlCode start="<sql:.\{-}>\s*\%[<!\[CDATA\[]" keepend
end="\ze\%[[]][]]>]\s*<\/sql:\w\{-}>" contains=@sql

But the following line doesn't work, it colors both tags as XML but
not the text inside as SQL
syntax region sqlCode start="<sql:.\{-}>\s*\%[<!\[CDATA\[]\zs" keepend
end="\ze\%[[]][]]>]\s*<\/sql:\w\{-}>" contains=@sql

This is kind of odd, anyone has any ideas?

--
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php

No comments: