swift-emacs / swift-mode

Emacs support for Apple's Swift programming language.
GNU General Public License v3.0
372 stars 47 forks source link

When switch case statements are fully indented, following lines are not at all #166

Closed woolsweater closed 4 years ago

woolsweater commented 4 years ago

When swift-mode:switch-case-offset is set equal to the basic offset, non-case lines following a case end up at the same indent level as the case itself, like so (both offsets are 4 for the example):

switch result {
    case let .success(value):
    print("Got \(value)!")
    handleSuccess(value)
    case let .failure(error):
    print("Got an error: \(error)")
    handleFailure(error)
}

The expected result is that the case line is indented, and then non-case lines "inside" it are also indented, by the basic offset.

switch result {
    case let .success(value):
        print("Got \(value)!")
        handleSuccess(value)
    case let .failure(error):
        print("Got an error: \(error)")
        handleFailure(error)
}