Skip to content

Commit

Permalink
Format: fix indentation after backslash newline (#5901)
Browse files Browse the repository at this point in the history
  • Loading branch information
makenowjust authored and RX14 committed Apr 2, 2018
1 parent 4d2ad83 commit 60f675c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 0 deletions.
2 changes: 2 additions & 0 deletions spec/compiler/formatter/formatter_spec.cr
Expand Up @@ -1104,6 +1104,8 @@ describe Crystal::Formatter do
assert_format "1 \\\nensure 2", "1 \\\n ensure 2"
assert_format "foo bar, \\\nbaz", "foo bar,\n baz"
assert_format "x 1, \\\n 2", "x 1,\n 2"
assert_format "begin\n 1 + \\\n 2\n 3\nend"
assert_format "begin\n 1 \\\n + 2\n 3\nend"

assert_format "alias X = ((Y, Z) ->)"

Expand Down
1 change: 1 addition & 0 deletions src/compiler/crystal/tools/formatter.cr
Expand Up @@ -4327,6 +4327,7 @@ module Crystal
old_indent = @indent
@indent = indent
value = yield
@passed_backslash_newline = false
@indent = old_indent
value
end
Expand Down

0 comments on commit 60f675c

Please sign in to comment.