codealignment icon indicating copy to clipboard operation
codealignment copied to clipboard

How to align with 4 spaces?

Open Danand opened this issue 8 years ago • 1 comments

Tabs are evil, you know. But I'd prefer to get this (not tabs, just spaces but more than 1):

SomeMethod(
    param1:    arg1,
    param2:    arg2, // 4 spaces.
    param3:    arg3)
{
    // ...
}

instead of this:

SomeMethod(
    param1: arg1, 
    param2: arg2, // 1 space.
    param3: arg3)
{
    // ...
}

BTW, I'm using this regular expression: :\s*(?<x>[^\s]).

Danand avatar Jul 19 '16 05:07 Danand

At the moment code alignment doesn't support this. There's the "add space" option which makes sure there is at least a single space so I guess this could be extended to allow a user specified number of spaces. However, I'm not sure if there's a huge benefit to this and could confuse people what it means.

I'll leave this issue open for now, if you or anyone else can come up with a nice implementation for this I'll accept the pull request.

cpmcgrath avatar Jul 24 '16 21:07 cpmcgrath