I want to have nested regions:
syn region fooParen start=+(+ end=+)+ keepend
contains=fooParenBrace
syn region fooParenBrace contained start=+{+ end=+}+
syn region fooBrace start=+{+ end=+}+ keepend
contains=fooBraceParen
syn region fooBraceParen contained start=+(+ end=+)+
Now I test it:
hi fooParen term=bold ctermfg=yellow guifg=yellow
hi fooBrace term=italic ctermfg=red guifg=red
hi fooParenBrace term=underline ctermfg=blue guifg=blue
hi link fooBraceParen fooParenBrace
This renders as expected:
( yellow { BLUE } yellow )
{ red ( BLUE ) red }
Now, I want to do interleaved/blended regions, so that I can make this
work:
( yellow { BLUE ) red }
I make a few modifications:
syn clear fooParen fooParenBrace fooBrace fooBraceParen
syn region fooParen start=+(+ end=+)+
keepend contains=fooParenBrace
syn region fooParenBrace contained start=+{+ end=+}+
contains=fooParenBraceParen
syn region fooParenBraceParen contained start=+)\&+ end=+}\&+ extend
syn region fooBrace start=+{+ end=+}+ keepend
contains=fooBraceParen
syn region fooBraceParen contained start=+(+ end=+)+
contains=fooBraceParenBrace
syn region fooBraceParenBace contained start=+}\&+ end=+)\&+ extend
hi link fooParenBraceParen fooBrace
hi link fooBraceParenBrace fooParen
This renders ( yellow { BLUE ) red } almost correctly... but it breaks
everything else. And I'm sure that most of the changes don't make sense,
since I can't understand them myself. ;)
So, how can I blend regions effectively and have them recurve
infinately/include all possible combinations?
Andres P
--
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