Indent switch/case labels
Can you indent switch cases like the xcode when you select it in Text editing preferences. On alternative can be a option in Swimat settings.
I tried editing your code with some success and a little bug with the break keyword after the break it will add another indent to the next case.
var checkInCase = false
if indent.inSwitch {
if isNext(word: "case") {
checkInCase = true
indent.count += 1
indent.inCase = true
} else if isNext(word: "default") || isNext(word: "@unknown") || isNext(word: "break") {
indent.extra -= 1
}
}
Another suggestion it's the break be at the same level as the case but this is just a opinion
I don't really get your mean, can you post some example please?
What is the other type you want to propose? @firetrap
I think that firetrap want to said below
There is an option in Text Editing, Xcode preference
Indent switch/case labels in
- [ ] Swift
- [ ] C/Objective-C/C++
switch condition {
case a:
break;
}
and
switch condition {
case a:
break;
}
I also want this :smile: