mirror of
https://github.com/atom/atom.git
synced 2026-01-23 22:08:08 -05:00
The method call was still bugging because it is only called once and is one line long. How about we make it a local var?
This commit is contained in:
@@ -32,18 +32,15 @@
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)shouldRunSpecsOnEvent:(NSEvent *)event {
|
||||
return [event modifierFlags] & (NSAlternateKeyMask | NSControlKeyMask | NSCommandKeyMask) && [[event charactersIgnoringModifiers] hasPrefix:@"s"];
|
||||
}
|
||||
|
||||
// Overridden
|
||||
- (void)sendEvent:(NSEvent *)event {
|
||||
if ([event type] != NSKeyDown) {
|
||||
[super sendEvent:event];
|
||||
return;
|
||||
}
|
||||
|
||||
if ([self shouldRunSpecsOnEvent:event]) {
|
||||
|
||||
BOOL shouldRunSpecs = [event modifierFlags] & (NSAlternateKeyMask | NSControlKeyMask | NSCommandKeyMask) && [[event charactersIgnoringModifiers] hasPrefix:@"s"];
|
||||
if (shouldRunSpecs) {
|
||||
[self createSpecController];
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -60,12 +60,9 @@
|
||||
return [self initWithBootstrapScript:@"bootstrap" url:url];
|
||||
}
|
||||
|
||||
- (BOOL)shouldReloadOnEvent:(NSEvent *)event {
|
||||
return [event modifierFlags] & NSCommandKeyMask && [[event charactersIgnoringModifiers] hasPrefix:@"r"];
|
||||
}
|
||||
|
||||
- (BOOL)handleInputEvent:(NSEvent *)event {
|
||||
if ([self shouldReloadOnEvent:event]) {
|
||||
BOOL shouldReload = [event modifierFlags] & NSCommandKeyMask && [[event charactersIgnoringModifiers] hasPrefix:@"r"];
|
||||
if (shouldReload) {
|
||||
[self reload];
|
||||
return YES;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user