0

Hope someone can help.

I am a new user to textmate and want to add code folding to if|endif & foreach|endforeach on textmate.

These are the current supported folds

foldingStartMarker = '(/\*|\{\s*$|<<<HTML)';
foldingStopMarker = '(\*/|^\s*\}|^HTML)';

I have tried

foldingStartMarker = '(/\*|\{\s*$|<<<HTML|if)';
foldingStopMarker = '(\*/|^\s*\}|^HTML|endif)';

Which starts the fold for an if but the stop Marker is not being picked up.

Has anyone else done this ?

Hope you can advise

Lee
  • 20,034
  • 23
  • 75
  • 102
  • I'm certain you want to add this codefolding to a certain programming language, because I can fold any loop or if-statement in a Ruby program. So which language do you target? – Florian Pilz Jan 06 '11 at 13:51
  • php if & endif also maybe foreach & endforeach – Lee Jan 06 '11 at 18:42

1 Answers1

0

Change The HTML bundle instead of the PHP bundle!

I've changed |array\s?(\s*$ into |array(\s*$ to get array folding. This might work for you as well.

I've also tried this: |array\s*(\s*$ because I want to fold array( as well as array ( or array    (. I don't know if this is exactly the right syntax, but it works perfectly!

Thanks to Chris Adams: http://old.nabble.com/Any-chance-of-a-little-help-sorting-this-language-regexp-to-make-php-coding-less-painful-in-textmate--td30458020.html

Linkmichiel
  • 2,110
  • 4
  • 23
  • 27