From 79c5fb94ac36707c79ef14c651ff6d5c75accc7a Mon Sep 17 00:00:00 2001 From: Ary Borenszweig Date: Fri, 27 Oct 2017 12:11:21 -0300 Subject: [PATCH] Formatter: fix bug regarding backslash --- spec/compiler/formatter/formatter_spec.cr | 1 + src/compiler/crystal/tools/formatter.cr | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/spec/compiler/formatter/formatter_spec.cr b/spec/compiler/formatter/formatter_spec.cr index 5c7bdc6c7ac7..667791aaed00 100644 --- a/spec/compiler/formatter/formatter_spec.cr +++ b/spec/compiler/formatter/formatter_spec.cr @@ -1081,6 +1081,7 @@ describe Crystal::Formatter do assert_format "1 \\\nrescue 2", "1 \\\n rescue 2" 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 "alias X = ((Y, Z) ->)" diff --git a/src/compiler/crystal/tools/formatter.cr b/src/compiler/crystal/tools/formatter.cr index 0abfbda64eb1..abd1e5cb5532 100644 --- a/src/compiler/crystal/tools/formatter.cr +++ b/src/compiler/crystal/tools/formatter.cr @@ -2390,8 +2390,8 @@ module Crystal write " " end end - skip_space_or_newline end + skip_space_or_newline end end