On 13/4/2006, at 5:49, Rupa Deadwyler wrote:
I need to figure out how to scope functions() that have other functions inside them, my first regex was not good at all. And I wish I could get %" to be completed as Smart Typing Pairs, but it seems you can only have one character in them :(
You sort of can. You need to add a rule to the language grammar, e.g.:
{ match = '%(\s)'; captures = { 1 = { name = "meta.incomplete-string-or-whatever"; }; }; },
Now when you enter % in the source, the scope of the caret should be the one shown above. So create a snippet which inserts whatever needs insertion ("$1"%) and give that snippet a key equivalent of " and scope of source.remind meta.incomplete-string-or-whatever.
Then if you type %" in a source.remind file, you should get %""% with the caret in the middle, and you can press tab to skip out of this string.
The rule is made so that this only works when the character following the % is a whitespace character (which includes newlines, so it also works when typing at the end of a line).