Skip to content

Commit 9162b30

Browse files
committed
Move application activate for AppleScript diff commands to gitx command
As the application in AppleScript is that applications do not automatically become active when performing an action, it appears more consistent to not activate the application when opening a diff and making the gitx command issue an activation command along with the open diff command to keep the existing behaviour. This also makes the implementation of open diff consistent with the implementation of the open (document/repository) command.
1 parent d2feedc commit 9162b30

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

Classes/Util/NSApplication+GitXScripting.m

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,6 @@ - (void)showDiffScriptCommand:(NSScriptCommand *)command
2323
if (diffText) {
2424
PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:diffText];
2525
[diffController showWindow:nil];
26-
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
2726
}
2827
}
2928

@@ -48,7 +47,6 @@ - (void)performDiffScriptCommand:(NSScriptCommand *)command
4847
if (diffOutput) {
4948
PBDiffWindowController *diffController = [[PBDiffWindowController alloc] initWithDiff:diffOutput];
5049
[diffController showWindow:self];
51-
[[NSApplication sharedApplication] activateIgnoringOtherApps:YES];
5250
}
5351
}
5452

Classes/gitx.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ void handleSTDINDiff()
101101

102102
if (diff && [diff length] > 0) {
103103
GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier];
104+
[gitXApp activate];
104105
[gitXApp showDiff:diff];
105106
exit(0);
106107
}
@@ -109,8 +110,8 @@ void handleSTDINDiff()
109110
void handleDiffWithArguments(NSURL *repositoryURL, NSArray *arguments)
110111
{
111112
GitXApplication *gitXApp = [SBApplication applicationWithBundleIdentifier:kGitXBundleIdentifier];
113+
[gitXApp activate];
112114
[gitXApp performDiffIn:repositoryURL withOptions:arguments];
113-
114115
exit(0);
115116
}
116117

0 commit comments

Comments
 (0)