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
SmartIndenter enhancement - strip/trim all spaces from blank lines #4363
Comments
That would be a fairly trivial change - right now the indenter is just basically just ignoring "empty" lines (those containing nothing but whitespace). The main question would be whether to even bother making this a settable option. Are there any instances where we wouldn't want to replace a line full of spaces with a simple newline? |
Linking chat. |
I like your comment:
My personal preference is the 'remove all spaces'. :) |
To me it makes sense for the indenter to remove the whitespace lines without an extra option to turn on and off. I can't think of any reason to want to preserve it. If this is made an optional setting then having it on by default seems like the way to go. |
For *your* preferences, perhaps. As far as I'm concerned, blank lines that
don't honor the indent level they're at, drive me nuts. I systematically
add that indent whenever I paste code from CR or SO into the VBE. If
current indent is 3 levels, I see no reason to suddenly have a blank line
(which is pretty often just completely arbitrarily left blank) at 0 indent
just because it's blank - if it's already indented then if I type a comment
(or an instruction) on that empty line then *it's already indented*.
To each their own - I fully support this being configurable, ...and I'm
strongly inclined to make "indent blank lines" the default.
… |
I just showed up to argue with Retailcoder. Git shows indentation on blank lines as white space error. It makes the diff noisy. Of course, VBA commits in Git tend to have a ton of noise anyway, so... yeah. I just felt like being contrary. Having an option is definitely the way to go. |
@rubberduck203 git diffs aren't any messier from Visual Studio, and to get VS to not indent empty lines, you have to actively be fighting the IDE. |
Now that I think about it I do indent blank rows and sometimes add or delete whitespace so that blank rows have the "proper" indentation in case I add something to them. Perhaps the indenter could stop ignoring blank lines and add or remove whitespace so that it indents every row, regardless of content. |
@CHR-IS-B I can see people preferring empty lines be left alone, as much as empty lines being indented, or any & all extraneous whitespace be eliminated - hence my pushing for a configurable setting 😄 |
@retailcoder I can understand that. |
Wow, just installed the latest release and this new 'remove' setting is awesome. So much easier to clean up code with predictable cursor movement. Thank you for implementing this!! |
This option would make it immensely easier to insert and delete blank lines while editing code if the SmartIndenter had an option to trim all spaces from blank lines when invoked.
The text was updated successfully, but these errors were encountered: