Hello Mates,
Folding is probably what drives me with open arms to you, guys. If I'm getting it to work, that is.
A pathological case is this vhdl construct:
loop do_something; exit when signal='1'; do_something_more; end loop;
My first attempt looks like this (just longer):
foldingStartMarker = "(?i:(loop|case|if))"; foldingStopMarker = "(?i:end)";
But this does not work, because the "loop" also matches the stopMarker! TextMate will not mark the end line at all, and get quite screwed up in building its folds. The same for "end if", "end case", to name a few.
Any reasonable ideas how to write a foldingStartMarker pattern that will _not_ trigger on the final line?
Peter
On 15-08-2005 14:22, Peter Vohmann wrote:
Any reasonable ideas how to write a foldingStartMarker pattern that will _not_ trigger on the final line?
Sure: foldingStartMarker = "(?i:(^\s*loop|case|if))";
Jeroen.
On 15.08.2005 14:50, Jeroen van der Ham wrote:
On 15-08-2005 14:22, Peter Vohmann wrote:
Any reasonable ideas how to write a foldingStartMarker pattern that will _not_ trigger on the final line?
Sure: foldingStartMarker = "(?i:(^\s*loop|case|if))";
...rrriiighht. Doing a match from the start of the line also helps to avoid if's in --commented lines, thanks a lot.
My final solution looks something like this, which will also allow a "Label:" before the statement:
foldingStartMarker = "(?i:^\s*(\w+:)?((entity|architecture| configuration|component|package|process|function|procedure|case|if| for|while|loop)\b))"; foldingStopMarker = "(?i:^\s*(end)\b)";
Thanks for the help, I surely wasted enough time on syntax highlighting already... ;-)
Peter
On 15-08-2005 15:12, Peter Vohmann wrote:
foldingStartMarker = "(?i:^\\s*(\w+:)?((entity|architecture|
configuration|component|package|process|function|procedure|case|if| for|while|loop)\b))";
Watch out: you need to escape 's in the regexp and you have "\w+" there which should be "\w+".
Jeroen.
And while we request folding stuff, how about javascript's
this.func = function(possible, arguments) { ... code ... };
I'm sure there are others as well, but it's the one I use .. oh, yes ...
Object.prototype.func = function (possible, arguments) { ... code ... };
and
Object.func = function (possible, arguments) { ... code ... };
seems that ... = function (possible, arguments) { ... code ... }; really is the trigger
this can also be ... = new Function("possible", "arguments", "code");
Andreas
On Aug 15, 2005, at 15:16 , Jeroen van der Ham wrote:
On 15-08-2005 15:12, Peter Vohmann wrote:
foldingStartMarker = "(?i:^\\s*(\w+:)?((entity|architecture|
configuration|component|package|process|function|procedure|case|if| for|while|loop)\b))";
Watch out: you need to escape 's in the regexp and you have "\w+" there which should be "\w+".
Jeroen.
-- http://www.je-ju.net/~jeroen/blog/ ______________________________________________________________________ For new threads USE THIS: textmate@lists.macromates.com (threading gets destroyed and the universe will collapse if you don't) http://lists.macromates.com/mailman/listinfo/textmate