Menu

#101 Unwanted removal of leading spaces in 'empty lines'

No Plans
wont-fix
nobody
None
5
2012-12-01
2009-05-26
Christian K
No

We indent our C# files with Space characters rather than Tab characters. When we hit the <enter> key twice after a line with C# code to create an 'empty line', our C# editor inserts not just an NL, but the correct amount of Space characters that goes with the current indentation level plus a NL character. That is the way we want it, because this makes it easier to lateron add code at the right indentation level in in this 'empty line', should it become necessary.
Uncrustify 'v.49+CVS' preserved this, but when testing v.53 I noticed that these Space characters are removed and only the NL is left.</enter>

Example:
string var1; // indentation level is four spaces
('empty line' consisting of four space characters and a NL character)
string varX; // indentation level is four spaces

Problem: Uncrustify reduces the 'empty line' to NL only and throws the leading space characters away.
Solution: Either fix this so it works as in v.49+CVS, or introduce an Option to instruct Uncrustify about how to treat that case.

This is with Uncrustify v.53 (I didn't test v.50, v.51, v.52).

Discussion

  • Ben Gardner

    Ben Gardner - 2009-07-04

    There is currently no support for preserving trailing spaces.
    I am not willing to create such a feature, but if you were to create an option to do what you want, then I would be willing to add it.

     
  • Ben Gardner

    Ben Gardner - 2012-12-01
    • status: open --> wont-fix
    • milestone: --> No Plans
     
MongoDB Logo MongoDB