On 8/28/06, Andy Wokula <[EMAIL PROTECTED]> wrote:
Yongwei Wu schrieb:
> I am trying to implement the COMMENT directive in the MASM syntax file:
>
> Treats all text between or on the same line as the delimiters as a comment.
>
> COMMENT delimiter [[text]]
> [[text]]
> [[text]] delimiter [[text]]
>
> The current way I deal with it is:
>
> syn match masmComment        "COMMENT\s*\(\W\)\_.\{-}\1.*"
>
> However, when the first line (containing `COMMENT') is not visible,
> refreshing the page will immediately render the highlighting wrong:
> the lines are no longer regarded as comments.
>
> I tried using region, but 1) I do not know how to let `end' find
> exactly the same delimiter as `start'; 2) refreshing the display still
> make the highlighting fail.
>
> I find that the multi-line C comments do not exhibit this problem. But
> I am not able to figure out the magic. Any help?
>
> Best regards,
>
> Yongwei

:help :syn-ext-match

HTH Andy

Thanks, Andy and Yakov. Yes, this works for region. I now use:

syn region masmComment          start=+COMMENT\s*\z(\W\)+ end=+\z1.*+

However, it is only a *little* better. Scroll down to make the first
comment line disappear on the top of the Vim window, and press Ctrl-L,
highlighting will have problems. C comments have not this problem.

More clues?

Best regards,

Yongwei
--
Wu Yongwei
URL: http://wyw.dcweb.cn/

Reply via email to