On Feb 18, 2:08 pm, Maxim Kim <[email protected]> wrote:
> On Feb 18, 10:48 pm, Brett Stahlman <[email protected]> wrote:
>
> > On Feb 18, 10:55 am, Maxim Kim <[email protected]> wrote:
> > You need to give level 2 the 'contained' attribute, and indicate that
> > level 1 can contain level 2: e.g.,
>
> > :syntax region level1 start=/^![^!]\+.*/ end=/\n\+\ze![^!]\+.*/
> > transparent fold contains=level2
> > :syntax region level2 start=/^!![^!]\+.*/ end=/\n\+\ze!!\?[^!]\+.*/
> > transparent fold contained
>
> Unfortunatly It doesn't work:
How about something like this?
:syntax region level1 start=/^![^!]\+.*/ end=/^![^!]\+.*/me=s-1 fold
contains=level2
:syntax region level2 start=/^!![^!]\+.*/ end=/^!!\?[^!]\+.*/me=s-1
fold contained
It works for me, but doesn't exclude the newlines leading up to the
next level. I don't have time right now to determine why the original
version with the \n\+\ze doesn't work properly. Perhaps I'll be able
to look at it tonight if no one else has answered...
Brett S.
>
> +-- 19 lines: ! Level 1----------
> !! Level 2
> blablabla
> blablabla
> blablabla
>
> +-- 4 lines: ! Level 1----------
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_use" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---