Skip to content

Commit d84601a

Browse files
committed
Disabled the default: case insertion (#24)
1 parent 016d61a commit d84601a

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

SCXcodeSwitchExpander/DVTTextCompletionController+SCXcodeSwitchExpander.m

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -167,16 +167,17 @@ - (BOOL)tryExpandingSwitchStatement
167167
switchContentRange = NSMakeRange(openingBracketLocation + 1, closingBracketLocation - openingBracketLocation - 1);
168168
switchContent = [textView.string substringWithRange:switchContentRange];
169169

170-
// Insert the default case if necessary
171-
if([switchContent rangeOfString:@"default"].location == NSNotFound) {
172-
if ([[SCXcodeSwitchExpander sharedSwitchExpander] isSwift]) {
173-
replacementString = [NSMutableString stringWithString:@"default: \nbreak\n\n"];
174-
} else {
175-
replacementString = [NSMutableString stringWithString:@"default: {\nbreak;\n}\n"];
176-
}
177-
[textView insertText:replacementString replacementRange:NSMakeRange(switchContentRange.location + switchContentRange.length, 0)];
178-
closingBracketLocation += replacementString.length;
179-
}
170+
// // Insert the default case if necessary
171+
// if([switchContent rangeOfString:@"default"].location == NSNotFound) {
172+
// if ([[SCXcodeSwitchExpander sharedSwitchExpander] isSwift]) {
173+
// replacementString = [NSMutableString stringWithString:@"default: \nbreak\n\n"];
174+
// } else {
175+
// replacementString = [NSMutableString stringWithString:@"default: {\nbreak;\n}\n"];
176+
// }
177+
// [textView insertText:replacementString replacementRange:NSMakeRange(switchContentRange.location + switchContentRange.length, 0)];
178+
// closingBracketLocation += replacementString.length;
179+
// }
180+
180181
// Re-indent everything
181182
NSRange reindentRange = NSMakeRange(openingBracketLocation, closingBracketLocation - openingBracketLocation + 2);
182183
[textView _indentInsertedTextIfNecessaryAtRange:reindentRange];

0 commit comments

Comments
 (0)