Skip to content
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

Closed
TroyB9 opened this issue Sep 13, 2018 · 11 comments
Closed

SmartIndenter enhancement - strip/trim all spaces from blank lines #4363

TroyB9 opened this issue Sep 13, 2018 · 11 comments
Assignees
Labels
enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-smart-indenter

Comments

@TroyB9
Copy link

TroyB9 commented Sep 13, 2018

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.

@comintern comintern added enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-smart-indenter labels Sep 13, 2018
@comintern
Copy link
Contributor

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?

@comintern
Copy link
Contributor

Linking chat.

@TroyB9
Copy link
Author

TroyB9 commented Sep 13, 2018

I like your comment:

Makes sense to me - adding an option for that would probably make me lean toward a "how to handle empty lines" setting.

( ) leave as is (current setting)
(*) remove all spaces
( ) pad to the current indent level 

My personal preference is the 'remove all spaces'. :)

@ChrisBrackett
Copy link

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.

@retailcoder
Copy link
Member

retailcoder commented Sep 18, 2018 via email

@rubberduck203
Copy link
Member

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.

@retailcoder
Copy link
Member

@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.

image

@ChrisBrackett
Copy link

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.

@retailcoder
Copy link
Member

@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 😄

@ChrisBrackett
Copy link

@retailcoder I can understand that.

@comintern comintern self-assigned this Sep 19, 2018
@TroyB9
Copy link
Author

TroyB9 commented Sep 27, 2018

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!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Feature requests, or enhancements to existing features. Ideas. Anything within the project's scope. feature-smart-indenter
Projects
None yet
Development

No branches or pull requests

5 participants