vim-wren icon indicating copy to clipboard operation
vim-wren copied to clipboard

Add interpolated expressions in strings

Open ghost opened this issue 7 years ago • 1 comments

ghost avatar May 24 '18 00:05 ghost

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.

crides avatar Jul 19 '18 13:07 crides