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
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@tyson.id.au aim: mikerusselltyson twitter: MichaelTyson
textmate mailing list textmate@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
Good question - I should've worked in # support the first time!
I've just added it in, as well as support for /* style comments - re- download from the original site, http://michael.tyson.id.au/2009/03/27/align-comments-in-textmate/
On 27/03/2009, at 2:13 PM, chad gulley wrote:
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.
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
On 2009-March-27 , at 00:03 , Michael Tyson wrote:
Good question - I should've worked in # support the first time!
I've just added it in, as well as support for /* style comments - re- download from the original site, http://michael.tyson.id.au/2009/03/27/align-comments-in-textmate/
what about using $TM_COMMENT_START instead of your regexp in the relevant_line_pattern = /^(.*?)[\t ]*(//|#|/*)[\t ]*(.*)/ column_search_pattern = /[\t ]*(//|#|/*)/ lines?
JiHO --- http://jo.irisson.free.fr/
On Mar 26, 2009, at Mar 26, 2009 | 11:03 PM, Michael Tyson wrote:
Good question - I should've worked in # support the first time!
I've just added it in, as well as support for /* style comments - re- download from the original site, http://michael.tyson.id.au/2009/03/27/align-comments-in-textmate/
On 27/03/2009, at 2:13 PM, chad gulley wrote:
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.
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
-- Michael Tyson | michael.tyson.id.au
m: (+61) 0407 754 124 e: michael@tyson.id.au aim: mikerusselltyson twitter: MichaelTyson
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
thanks so much!
Great! Thanks.
What about putting this in the official source bundle? Is Allan responsible for this bundle? I think that would be useful for a lot of people.
Best regards, Mathieu
___________________________________________
Mathieu Godart
Skype: mathieu_godart MSN: mathieu_godart@hotmail.com
ASIC Integration Manager Coolsand Technologies ___________________________________________
Le 27 mars 09 à 13:50, chad gulley a écrit :
On Mar 26, 2009, at Mar 26, 2009 | 11:03 PM, Michael Tyson wrote:
Good question - I should've worked in # support the first time!
I've just added it in, as well as support for /* style comments - re-download from the original site, http://michael.tyson.id.au/2009/03/27/align-comments-in-textmate/
On 27/03/2009, at 2:13 PM, chad gulley wrote:
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.
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
-- Michael Tyson | michael.tyson.id.au
m: (+61) 0407 754 124 e: michael@tyson.id.au aim: mikerusselltyson twitter: MichaelTyson
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
thanks so much!
textmate mailing list textmate@lists.macromates.com http://lists.macromates.com/listinfo/textmate
On 27 Mar 2009, at 16:41, Mathieu Godart wrote:
What about putting this in the official source bundle? Is Allan responsible for this bundle? I think that would be useful for a lot of people.
I’ve made a note of it, thanks.
Though the key (⌥⌘/) already has an action: Insert Block Comment (or wrap selection in a block comment).
Ideally we’d put it on the same key as Align Assiigments, but unfortunately it can’t be smart enough to really detect what the user want to align on. Would it be ok to scope the command to ‘command’ so that using ⌥⌘] in regular source does the Align Assignments but moving inside the commetn, would make it line up the comments?
Le 8 avr. 09 à 21:46, Allan Odgaard a écrit :
On 27 Mar 2009, at 16:41, Mathieu Godart wrote:
What about putting this in the official source bundle? Is Allan responsible for this bundle? I think that would be useful for a lot of people.
I’ve made a note of it, thanks.
Though the key (⌥⌘/) already has an action: Insert Block Comment (or wrap selection in a block comment).
Ideally we’d put it on the same key as Align Assiigments, but unfortunately it can’t be smart enough to really detect what the user want to align on. Would it be ok to scope the command to ‘command’ so that using ⌥⌘] in regular source does the Align Assignments but moving inside the commetn, would make it line up the comments?
I cannot answer this question: using a keyboard with a french layout, I have to overwrite all the shortcuts using "]"... Personally, I use ⌥⇥ to indent the line / selection and ⌥⇧⇥ to align the assignments.