Friday, September 30, 2016

Re: syntax match bug: 'keepend' not officially supported, but required in some cases

Brett Stahlman wrote:
> The syntax documentation suggests that the 'keepend' argument applies
> only to syntax regions, not syntax matches. But if I highlight a
> buffer containing only the following line...
>
> ABCDE
>
> ...with the following syntax definitions...
>
> syn match A /A/
> syn match Inside /[A-Z]\+/ transparent contained containedin=A
> hi A guifg=blue
>
> ...the match group "A" extends (apparently incorrectly) from A through
> E, though its pattern matches only the "A". Stranger still, one
> additional nested "Inside" group is recognized in each successive
> letter. I.e., "Inside" is contained within "Inside", in spite of the
> `containedin=A'. Thus, running synstack on successive characters, I
> see...
>
> -- cursor on A --
> A
> Inside
> -- cursor on B --
> A
> Inside
> Inside
> -- cursor on C --
> A
> Inside
> Inside
> Inside
>
>
> I can fix the problem by adding the 'keepend' argument to the
> definition for match group "A", but the "keepend" is highlighted as an
> error by the vim syntax, and the help on :syn-match gives me no reason
> to believe the argument should be supported.
>
Hello:

Since the help will be changed to reflect keepend being allowed at the
end of a match... well, try
http://www.drchip.org/astronaut/vim/index.html#SYNTAX_VIM for an update
to the highlighting thereof.

Regards,
Chip Campbell

--
--
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

---
You received this message because you are subscribed to the Google Groups "vim_use" group.
To unsubscribe from this group and stop receiving emails from it, send an email to vim_use+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment