Skip to content

Commit

Permalink
fix curly indent error
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintin committed May 13, 2018
1 parent a6544a2 commit 9ff005e
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
4 changes: 3 additions & 1 deletion Parser/SwiftParser.swift
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,9 @@ class SwiftParser {
indent.inSwitch = true
isNextSwitch = false
}
retString = retString.trim()
indent.count -= 1
trimWithIndent()
indent.count += 1
if !retString.last.isUpperBlock() {
retString.keepSpace()
}
Expand Down
8 changes: 5 additions & 3 deletions SwimatTests/tests/n-curly-new-line/after.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// #182
if condition
{
expression()
if condition {
if condition
{
expression()
}
}
8 changes: 5 additions & 3 deletions SwimatTests/tests/n-curly-new-line/before.swift
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// #182
if condition
{
expression()
if condition {
if condition
{
expression()
}
}

0 comments on commit 9ff005e

Please sign in to comment.