[TxMt] Re: Command to align comments

chad gulley cag at adfitech.com
Fri Mar 27 03:13:15 UTC 2009


On Mar 26, 2009, at Mar 26, 2009  |  8:52 PM, Michael Tyson wrote:

> Hi folks,
>
> In case anyone else is interested, I've just put together a command  
> that aligns comments in a block - a trivially modified version of  
> Chris Poirer's 'align assignments' script.
>
> It fixes this:
>
> imagecopy($image, $frame,
>           ($x=max($width-$this->topRightCap[kCapWidth], $this- 
> >topLeftCap[kCapWidth])), // Destination x
>           0,  // Destination y
>           $x,  // Source x
>           0,  // Source y
>           min($this->topRightCap[kCapWidth], $width-$this- 
> >topLeftCap[kCapWidth]),  // Source width
>           $this->topRightCap[kCapHeight]); // Source height
>
> Ctrl-Option-Command-/, then:
>
> imagecopy($image, $frame,
>           ($x=max($width-$this->topRightCap[kCapWidth], $this- 
> >topLeftCap[kCapWidth])), // Destination x
>            
> 0 
> ,                                                                            // Destination 
>  y
>            
> $ 
> x 
> ,                                                                           // Source 
>  x
>            
> 0 
> ,                                                                            // Source 
>  y
>           min($this->topRightCap[kCapWidth], $width-$this- 
> >topLeftCap[kCapWidth]),      // Source width
>           $this- 
> > 
> topRightCap 
> [kCapHeight]);                                              //  
> Source height
>
> More info & download at http://michael.tyson.id.au/2009/03/27/align-comments-in-textmate/
>
> Cheers,
>
> Michael
>
> -- 
> Michael Tyson | michael.tyson.id.au
>
> m: (+61) 0407 754 124
> e: michael at tyson.id.au
> aim: mikerusselltyson
> twitter: MichaelTyson
>
>
> _______________________________________________
> textmate mailing list
> textmate at lists.macromates.com
> http://lists.macromates.com/listinfo/textmate


michael,

fantastic command.  i'm really glad to have something like this!  what  
would i need to do to allow it to support the '#' comment in addition  
to '//'?

thanks.
chad

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macromates.com/textmate/attachments/20090326/46707638/attachment.html>


More information about the textmate mailing list