[SVN] Re: Align Source

Mads Hartmann Jensen Mads379 at gmail.com
Fri May 20 12:55:16 UTC 2011


Ah, interesting. 

Once I have handed in my BSc project I will take a swing at this if you
haven't gotten to it by then :)

Cheers,
Mads Hartmann Jensen 


Allan Odgaard-4 wrote:
> 
> Thanks for sharing.
> 
> I’ve been meaning to rework this command for quite some time, the basic
> algorithm I want to do is here: http://pastie.textmate.org/747958
> 
> The align function takes a regexp which must have two captures. It match
> each line against the regexp and then ensures that spacing is inserted
> after capture one so that capture two falls on the same column for each
> line.
> 
> In the example we first match up to comma followed by a space, aligns on
> that, and then matches up to the closing brace, and align on that.
> 
> The thing I haven’t written yet is a way to automatically figure out the
> regexp from the user’s code. I think this would be possible with some
> heuristic which finds the first candidate character which exist for each
> non-empty line, and which isn’t already aligned. One could perhaps cycle
> through candidate matches on successive runs.
> 
> I’ve never gotten around to trying implementing such heuristic though.
> 

-- 
View this message in context: http://old.nabble.com/Align-Source-tp31636561p31663873.html
Sent from the textmate-dev mailing list archive at Nabble.com.



More information about the textmate-dev mailing list