swiftlang / swift-format

Formatting technology for Swift source code
Apache License 2.0
2.38k stars 216 forks source link

Leading whitespace on newlines #713

Open SENTINELITE opened 2 months ago

SENTINELITE commented 2 months ago

Xcode's default spacing for newlines ( "empty" lines) contains 4x leading spaces. I tried digging through all the options & wasn't able to find a way to use swift-format, & maintain that behavior.

Example Code (Take a look at lines 2 & 4.

    func XO() {}

    func xp() {}
    //What I Want

Code export

ahoppen commented 2 months ago

Tracked in Apple’s issue tracker as rdar://126948449

GeorgeLyon commented 2 weeks ago

+1, I realize this isn't a priority for open source, but it would be great to be able to create a "doesn't conflict with control-I in Xcode" `.swift-format"