swiftlang / swift-format

Formatting technology for Swift source code
Apache License 2.0
2.56k stars 231 forks source link

Inconsistency in formatting of multiline conditional statements #885

Open adam-fowler opened 5 days ago

adam-fowler commented 5 days ago

With respectsExistingLineBreaks set to true

let a = this ||
    that
// after formatting becomes
let a = this || that

and

let a = this
    || that
// after formatting becomes
let a = 
    this
    || that

Why are newlines respected in the second case but not the first

ahoppen commented 5 days ago

Synced to Apple’s issue tracker as rdar://140672947