Skip to content

Commit

Permalink
better selection of cd directory with packages
Browse files Browse the repository at this point in the history
  • Loading branch information
jbtule committed Oct 11, 2019
1 parent 8b10d60 commit d4e8818
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ Version 3.1
* *bug* fix 3.0 introduced bug for opening windows without selection
* Faster
* Fix Regression: Hide icon in dock
* if package is selected, cd parent directory, if in package cd own directory
* Less entitlements
* Setting to enable feature that closes extra opened windows
* Setting to enable choosing a different terminal theme for opened windows
Expand Down
4 changes: 3 additions & 1 deletion cd to .../cd to .../main.m
Original file line number Diff line number Diff line change
Expand Up @@ -27,16 +27,18 @@ int main(int argc, const char * argv[]) {
FinderItem *target = [(NSArray*)[[finder selection] get] firstObject];
FinderFinderWindow* findWin = [[finder FinderWindows] objectAtLocation:@1];
findWin = [[finder FinderWindows] objectWithID:[NSNumber numberWithInteger: findWin.id]];
bool selected = true;
if (target == nil){
target = [[findWin target] get];
selected = false;
}

if ([[target kind] isEqualToString:@"Alias"]){
target = (FinderItem*)[(FinderAliasFile*)target originalItem];
}

NSString* fileUrl = [target URL];
if(fileUrl != nil && ![fileUrl hasSuffix:@"/"]){
if(fileUrl != nil && ![fileUrl hasSuffix:@"/"] && selected){
fileUrl = [fileUrl stringByDeletingLastPathComponent];
}

Expand Down
4 changes: 2 additions & 2 deletions cd to .../cd to.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -256,7 +256,7 @@
CODE_SIGN_ENTITLEMENTS = "cd to .../cd_to.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = VURRGRYW45;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "cd to .../Info.plist";
Expand All @@ -277,7 +277,7 @@
CODE_SIGN_ENTITLEMENTS = "cd to .../cd_to.entitlements";
CODE_SIGN_STYLE = Automatic;
COMBINE_HIDPI_IMAGES = YES;
CURRENT_PROJECT_VERSION = 1;
CURRENT_PROJECT_VERSION = 2;
DEVELOPMENT_TEAM = VURRGRYW45;
ENABLE_HARDENED_RUNTIME = YES;
INFOPLIST_FILE = "cd to .../Info.plist";
Expand Down

0 comments on commit d4e8818

Please sign in to comment.