Im trying to add code folding regular expressions for a templating language I use
Even if I pare it back to the most basic of examples, I cant seem to get it working..
{if (true)} {foo} {/if}
foldingStartMarker = '^{if}'; foldingStopMarker = '^{\if}';
If I omit the closing } from the first line of code...
{if (true)
Then TM does show the code folding marker (odd since the regexp should require it?), but either way the code still doesn't fold
What am I missing?
Thanks
On 14 Oct 2015, at 19:38, Carpii UK wrote:
Im trying to add code folding regular expressions for a templating language I use
Even if I pare it back to the most basic of examples, I cant seem to get it working..
{if (true)} {foo} {/if}
foldingStartMarker = '^{if}'; foldingStopMarker = '^{\if}';
Based on your example, I think it should instead be:
foldingStartMarker = '^{if.*}'; foldingStopMarker = '^{/if}';
Based on your example, I think it should instead be:
foldingStartMarker = '^\{if.*\}'; foldingStopMarker = '^\{/if\}';
Thanks but I can't get your regexp working with this code either
{if (true)} {foo} {/if}
Even if I write invalid code just to allow the regexp to be simpler, its still failing to parse it....
{if} {foo} {/if}
foldingStartMarker = '^{if}'; foldingStopMarker = '^{/if}';
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 14 Oct 2015, at 19:49, Carpii UK wrote:
Thanks but I can't get your regexp working with this code either
{if (true)} {foo} {/if}
Works here.
Might be a scope issue.
Try select Bundles → Select Bundle Item…
Click “Settings” and enter “folding”.
Do you see your own settings at the top?
If not, then you might need to change their scope selector.
All working now, thanks Allan
I'd added my regexps into the Language Grammar instead of Settings -> Folding entry
I was working from the TM Manual, but I guess it only applies to TM1.. https://manual.macromates.com/en/language_grammars.html
Had I restarted TM, I would have noticed my rules disappear form the grammar anyway, implying they were invalid
On 14 October 2015 at 13:58, Allan Odgaard mailinglist@textmate.org wrote:
On 14 Oct 2015, at 19:49, Carpii UK wrote:
Thanks but I can't get your regexp working with this code either
{if (true)} {foo} {/if}
Works here.
Might be a scope issue.
Try select Bundles → Select Bundle Item…
Click “Settings” and enter “folding”.
Do you see your own settings at the top?
If not, then you might need to change their scope selector.
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Your regexes in no way resemble the code example. Back and forward slashes do not match each other. Plain if is never followed by closing curly brace. m.
-- Sent from my iPad, but I am not a dork. Really. matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 9! http://shop.oreilly.com/product/0636920044352.do iOS 9 Fundamentals! http://shop.oreilly.com/product/0636920044345.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
On Oct 14, 2015, at 5:38 AM, Carpii UK carpii.uk@gmail.com wrote:
Im trying to add code folding regular expressions for a templating language I use
Even if I pare it back to the most basic of examples, I cant seem to get it working..
{if (true)} {foo} {/if}
foldingStartMarker = '^{if}'; foldingStopMarker = '^{\if}';
If I omit the closing } from the first line of code...
{if (true)
Then TM does show the code folding marker (odd since the regexp should require it?), but either way the code still doesn't fold
What am I missing?
Thanks
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
Your regexes in no way resemble the code example. Back and forward slashes do not match each other. Plain if is never followed by closing curly brace. m.
Yeah I really messed up that example I'd changed the code and the regexp halfway through posting
-- Sent from my iPad, but I am not a dork. Really. matt neuburg, phd = http://www.apeth.net/matt/ pantes anthropoi tou eidenai oregontai phusei Programming iOS 9! http://shop.oreilly.com/product/0636920044352.do iOS 9 Fundamentals! http://shop.oreilly.com/product/0636920044345.do RubyFrontier! http://www.apeth.com/RubyFrontierDocs/default.html
On Oct 14, 2015, at 5:38 AM, Carpii UK carpii.uk@gmail.com wrote:
Im trying to add code folding regular expressions for a templating language I use
Even if I pare it back to the most basic of examples, I cant seem to get it working..
{if (true)} {foo} {/if}
foldingStartMarker = '^{if}'; foldingStopMarker = '^{\if}';
If I omit the closing } from the first line of code...
{if (true)
Then TM does show the code folding marker (odd since the regexp should require it?), but either way the code still doesn't fold
What am I missing?
Thanks
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate