cromwellryan / Gister

Gister creates gists in Visual Studio
MIT License
24 stars 10 forks source link

Trim whitespace character at the beginning of the line #6

Open toburger opened 11 years ago

toburger commented 11 years ago

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

billmoling commented 11 years ago

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.

toburger commented 11 years ago

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
}
cromwellryan commented 11 years ago

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

billmoling commented 11 years ago

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