From a6544a2b1ef5aad2e74cd763bec100db79527f4d Mon Sep 17 00:00:00 2001 From: Jintin Lin Date: Sun, 13 May 2018 23:04:09 +0800 Subject: [PATCH] fix #182 --- Parser/SwiftParser.swift | 1 + SwimatTests/tests/n-curly-new-line/after.swift | 5 +++++ SwimatTests/tests/n-curly-new-line/before.swift | 5 +++++ SwimatTests/tests/n-curly-new-line/preferences.json | 4 ++++ 4 files changed, 15 insertions(+) create mode 100644 SwimatTests/tests/n-curly-new-line/after.swift create mode 100644 SwimatTests/tests/n-curly-new-line/before.swift create mode 100644 SwimatTests/tests/n-curly-new-line/preferences.json diff --git a/Parser/SwiftParser.swift b/Parser/SwiftParser.swift index 488ebd7..3afc4fc 100644 --- a/Parser/SwiftParser.swift +++ b/Parser/SwiftParser.swift @@ -246,6 +246,7 @@ class SwiftParser { indent.inSwitch = true isNextSwitch = false } + retString = retString.trim() if !retString.last.isUpperBlock() { retString.keepSpace() } diff --git a/SwimatTests/tests/n-curly-new-line/after.swift b/SwimatTests/tests/n-curly-new-line/after.swift new file mode 100644 index 0000000..19c73b6 --- /dev/null +++ b/SwimatTests/tests/n-curly-new-line/after.swift @@ -0,0 +1,5 @@ +// #182 +if condition +{ + expression() +} diff --git a/SwimatTests/tests/n-curly-new-line/before.swift b/SwimatTests/tests/n-curly-new-line/before.swift new file mode 100644 index 0000000..19c73b6 --- /dev/null +++ b/SwimatTests/tests/n-curly-new-line/before.swift @@ -0,0 +1,5 @@ +// #182 +if condition +{ + expression() +} diff --git a/SwimatTests/tests/n-curly-new-line/preferences.json b/SwimatTests/tests/n-curly-new-line/preferences.json new file mode 100644 index 0000000..ea435a2 --- /dev/null +++ b/SwimatTests/tests/n-curly-new-line/preferences.json @@ -0,0 +1,4 @@ +{ + "areParametersAligned": false, + "areSemicolonsRemoved": false +}