Gister icon indicating copy to clipboard operation
Gister copied to clipboard

Trim whitespace character at the beginning of the line

Open toburger opened this issue 12 years ago • 4 comments

It would be nice if the whitespace characters at the beginning of the lines would be trimmed, so that the code is indentet nicely.

toburger avatar Dec 06 '12 14:12 toburger

Do you mean trim every line of the code? all the white space at the beginning of the whole gist? For the first question, it will be hard. it may mess up the code outline for whole code part. For the 2nd question. it is easy to fix.

billmoling avatar Dec 09 '12 04:12 billmoling

I think the goal should be to trim every single line (preserving the indentations rules selected in visual studio).

   public class Foo
   {
        // bar
   }

becomes

public class Foo
{
    // bar
}

toburger avatar Dec 12 '12 07:12 toburger

Hmm - while I can see that being a nice thing to do, it makes me nervous. Thar be dragons.

cromwellryan avatar Dec 12 '12 16:12 cromwellryan

@cromwellryan I think there is a possible way to implement this which to find the smallest space number in all lines and remove them.

billmoling avatar Dec 13 '12 00:12 billmoling