Skip to content

Commit

Permalink
fix #191
Browse files Browse the repository at this point in the history
  • Loading branch information
Jintin committed Sep 1, 2018
1 parent 9ff005e commit a01fbcd
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 6 deletions.
11 changes: 5 additions & 6 deletions Parser/Indent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,12 +82,11 @@ class Indent {
self.extraAdd = false
}

switch block {
case .parentheses:
self.leading = max(offset - count * Indent.size - 1, 0)
default: break
}
if !Indent.paraAlign {
if Indent.paraAlign {
if block != .curly {
self.leading = max(offset - count * Indent.size - 1, 0)
}
} else {
self.leading = 0
}
}
Expand Down
13 changes: 13 additions & 0 deletions SwimatTests/tests/n-statement-align/after.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// #191
let x = ["one",
"two",
"three"]

let x = [
"one",
"two",
"three"]

let x = (one ||
two ||
three)
13 changes: 13 additions & 0 deletions SwimatTests/tests/n-statement-align/before.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// #191
let x = ["one",
"two",
"three"]

let x = [
"one",
"two",
"three"]

let x = (one ||
two ||
three)
5 changes: 5 additions & 0 deletions SwimatTests/tests/n-statement-align/preferences.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"areParametersAligned": true,
"areSemicolonsRemoved": false
}

0 comments on commit a01fbcd

Please sign in to comment.