Indent inside strings after line-ending backslash #43
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.
Fix #9.
Note there are a few different ways it tries to determine how to indent a line within a string. Here are some examples from the tests:
In the first function, the continuation aligns with the start of the string. In the second, it pushes out to the next indentation level, since there is nothing in the string on the previous line. (This is intended to be similar to how it indents lists inside parentheses--aligns to the open paren if there is anything following it on the same line, indent to next level otherwise.)
If the line ending with a backslash is not the first line in the string, the indent level of that line is used to continue it. In the third function, the indentation will change the whitespace before the lines beginning in
*
in order to align them with their previous lines. It will leave all the other lines of that string entirely untouched.