Wednesday, February 3, 2010

Re: Syntax region problem

Gregor Uhlenheuer wrote:
> Hi,
>
> I have got a small problem with a syntax region meant to match some
> nested comments in a syntax script.
>
> That's the line:
> syn region mComment start=/\/\*/ end=/\*\// contains=mComment
>
> short example:
>
> /* this should be highlighted as a /* comment */ */
> this text is correctly not highlighted
> this text is correctly not highlighted
> this text is correctly not highlighted
>
> /* this should be highlighted as a /* comment */*/
> this text is highlighted, but shouldn't
> this text is highlighted, but shouldn't
> this text is highlighted, but shouldn't
>
> Somehow the syntax needs that whitespace between the two comment ends,
> but it should not. I hope I described my problem understandable :)

Gregor,

Try something like this...
syn region mComment matchgroup=mCommentMg start=/\/\*/ end=/\*\//
\ contains=mComment
hi link mComment Comment
hi link mCommentMg Comment

:help matchgroup

Hope it helps,
Brett Stahlman

>
> Best regards,
> Gregor
>

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

No comments:

Post a Comment