On pressing backspace+Enter, keep cursor indent #98
+9
−21
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.
When I want to "exit" a block of code while writing it, I press
<backspace>
. For example, I'm writing this:When I press backspace, I'll get something like this:
But then, I want to leave some space after the block, so I hit
<enter>
. The result is that the indent of the new line is set to the one of the last non-blank line:While this seems to be a minor issue, it trips me up all the time. I suppose I should get used to leaving the space first with an
<enter>
, but I can't seem to do so :). In python, the behaviour is exactly as I want it to be, so I took a cue from that indent file and I tweaked this one to work like that.I understand there may be some specific reason to have it this way. If so, I have no complaints to rejecting this PR outright.