vim-wren
vim-wren copied to clipboard
Add interpolated expressions in strings
Hi, I happened to be think about this before I actually see this repo! I managed to do the following:
syn region wrenInterpol transparent matchgroup=wrenInterpolParen start="%(" end=")" contained containedin=wrenString contains=ALL
hi link wrenInterpolParen Special
There are 2 problems with this. First, because the group is transparent, when there is only one variable in the group for example, that variable would be highlighted as if it was a string. i.e. I can't think of a way to "unhighlight" it. Second, the brackets are not balanced.
And of course, by now, because there is no way to match matching brackets in vim regex, the pattern would end as soon as it hits a ). I'm thinking about if we need to add some transparent groups matching the (), [], {}'s, so that we can emulate the bracket matching.
And there's actually an example of this, if you would like to checkout Lua's syntax highlighting in vim. The highlight group is different for function() ... end, unlike the if ... then ... end and for ... do ... end blocks.