You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Sep 6, 2021. It is now read-only.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The reason will be displayed to describe this comment to others. Learn more.
I added this 2nd conditional to handle the situation where there is actual text on the line. This will remove the whitespace between the electric char and the first non whitespace. That behaviour is contrary to our conversation in the issue, but it seemed more consistent with the prior case (all whitespace). If this is not desired, then the else condition can be removed.
Can you describe a concrete case for the 2nd condition where you think this is desirable? In the 1st condition, the desire is to never leave whitespace at the end of a line after non-ws chars. But in the 2nd condition, I can't think of any case where the user intent is clear enough that we'd want to try to be smart about ws between non-ws chars.
The reason will be displayed to describe this comment to others. Learn more.
I am not sure I see a concrete use case, so you're probably right, we should probably just leave the whitespace alone... very socialist, and I am Canadian, so this meshes well with me ;)
dangoor
changed the title
fix for #8395
Recognize existing indentation when autoclosing braces
Jul 21, 2014
dangoor
changed the title
Recognize existing indentation when autoclosing braces
Recognize existing indentation when indenting close braces
Jul 21, 2014
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this PR addresses #8395 and is a 2nd attempt. I refactored my fix based on feedback from @peterflynn and @redmunds in #8426