Hi,
** apoloigies if you're reading this again, posted it as a reply to other topic, rather than new message.... idiot. :-(**
Having a small problem changing the HTML wrapping setup to accommodate php docblocks.
I use alt-cmd-[ to reformat my code, and it (unsurprisingly) resets docblock comments to
/** * A comment **/
However, I like my coments to fold!
I've tried changing the HTML language to cope with this, but I can't quite get it to work. I can get
/** * A comment **/
to fold with :
foldingStartMarker = '(?x) (<(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset|style| script|ul|ol|li|form|dl)\b.*?> |<!--(?!.*--\s*>) |^<!--\ \#tminclude\ (?>.*?-->)$ |<?(?:php)?.*\b(if|for(each)?|while)\b.+: |{{?(if|foreach|capture|literal|foreach|php|section|strip) |{\s*($|?>\s*$|//|/*(.**/\s*$|(?!.*?*/))) |^\s*/**\s*$ # added for folding docblocks )'; foldingStopMarker = '(?x) (</(?i:head|body|table|thead|tbody|tfoot|tr|div|select|fieldset| style|script|ul|ol|li|form|dl)> |^(?!.*?<!--).*?--\s*> |^<!--\ end\ tminclude\ -->$ |<?(?:php)?.*\bend(if|for(each)?|while)\b |{{?/(if|foreach|capture|literal|foreach|php|section|strip) |^[^{]*} |^\s***/\s*$ # added for folding docblocks )';
But can't seem to get the two spaces before the ** on the last line to take.
Is there some trick with the regex I'm missing, or can I change the behaviour of alt-cmd-[ ?
TIA
R
-- Richard Dyce MA (Cantab.) MBCS MIET -- Richard Dyce MA (Cantab.) MBCS MIET
On Nov 21, 2008, at 4:58 AM, Richard Dyce wrote:
Having a small problem changing the HTML wrapping setup to accommodate php docblocks.
I use alt-cmd-[ to reformat my code, and it (unsurprisingly) resets docblock comments to
/**
- A comment
**/
However, I like my coments to fold!
Folding markers must have the same indentation level, the regex isn't even run if they don't so there isn't any way to 'regex' around this.
On 21 Nov 2008, at 18:53, Michael Sheets wrote:
Folding markers must have the same indentation level, the regex isn't even run if they don't so there isn't any way to 'regex' around this.
[ How strange. How do they determine that the markers are at the same indentation level without a regex? :-) ]
So, as an alternative, is it possible to change how the re-indent cmd- alt-[ deals with docblocks?
It seems churlish to offer folding, and then have a reformat tool which works to make existing, foldable comments unfoldable...
-- Richard Dyce MA (Cantab.) MBCS MIET