codealignment icon indicating copy to clipboard operation
codealignment copied to clipboard

Add ability to remove excess white space

Open cpmcgrath opened this issue 12 years ago • 2 comments

If you edit a line which has an alignment on it, there's a good chance that this will break the alignment. Doing the alignment again fixes it but can add too much white space. For example,

var distanceTravelled = 10;
var x                 =  5;

And then we decide to improve the name of x

var distanceTravelled = 10;
var xCoordinate                 =  5;

And then we do an alignment

var distanceTravelled           = 10;
var xCoordinate                 =  5;

There should be a way to remove the excess white space...

var distanceTravelled = 10;
var xCoordinate       =  5;

cpmcgrath avatar Sep 09 '12 23:09 cpmcgrath

So, any plan on implementing this? It seems that it's been open for more than 4 years. Maybe if I can have some tip on where to look at, I can try to see if I can implement it

farzadmf avatar Oct 25 '16 21:10 farzadmf

Quick update on my thinking for this: I'd love this functionality, but it's always been something that I've always been cautious about implementing as we'd need a way to make sure it can be implemented across editors. In terms of the implementation, one of the main code alignment design guidelines it should follow is to be Deliberate - Deleting whitespace should not just be a side effect of a function.

Personally, I don't really mind using column marking to achieve this, so I don't see it as a high priority. Would be happy to accept a pull request though.

cpmcgrath avatar Jan 06 '20 01:01 cpmcgrath