Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Would like to be able to align by longest operator #2

Open
samloeschen opened this issue Jan 13, 2019 · 2 comments
Open

Would like to be able to align by longest operator #2

samloeschen opened this issue Jan 13, 2019 · 2 comments

Comments

@samloeschen
Copy link

Hey there, currently a block like this:

{
    int x = 0;
    y += 1;
    int z = 2; 
}

will align to look like this:

{
    int x   = 0;
    y       += 1;
    int z   = 2;
}

and it would be awesome if there was an option to align/indent by the length of the longest operator, so that it would look like this:

{
    int x   = 0;
    y      += 1;
    int z   = 2;
}

I often have blocks with multiple operators and assignments, and would really love to be able to align them all cleanly.

@bladnman
Copy link
Owner

bladnman commented Feb 9, 2020

Sam, that's an interesting idea really. I'd agree that looks and reads better. Maybe I'll get a chance to dive into something like this but I'm pretty preoccupied these days.

I'd love a PR for this. :)

@non-bin
Copy link

non-bin commented Oct 15, 2021

I think this ties into something I'd like, which is to be able to align multiple things on each line, like a csv file

produces:
kilo  , k,10^3,thousand
hecto , h,10^2,hundred
deca  , da,10^1,ten

should be:
kilo  , k  , 10^3 , thousand
hecto , h  , 10^2 , hundred
deca  , da , 10^1 , ten

I'll have a look at making a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants