Skip to content

Commit ee1778d

Browse files
committed
Small fix for switch instruction matching (incomplete)
1 parent 7acb135 commit ee1778d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

SCXcodeSwitchExpander/DVTTextCompletionController+SCXcodeSwitchExpander.m

+1-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ - (void)tryExpandingSwitchStatement
8282
}
8383

8484
// See if the current line has a switch statement
85-
NSRange switchRange = [textView.string rangeOfString:@"switch" options:0 range:NSMakeRange(newLineRange.location, self.session.wordStartLocation - newLineRange.location)];
85+
NSRange switchRange = [textView.string rangeOfString:@"\\s+switch\\s+" options:NSRegularExpressionSearch range:NSMakeRange(newLineRange.location, self.session.wordStartLocation - newLineRange.location)];
8686
if(switchRange.location == NSNotFound) {
8787
return;
8888
}

0 commit comments

Comments
 (0)