Skip to content

Commit

Permalink
If a project consists of multiple root items, infer the project direc…
Browse files Browse the repository at this point in the history
…tory by getting the parent path of the first item in the project drawer.
  • Loading branch information
pnomolos committed Sep 14, 2011
1 parent fd2f7a6 commit 908953f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion PeepOpen-tmplugin/PeepOpen.m
Expand Up @@ -42,9 +42,12 @@ - (void)goToFile:(id)sender

if (project != NULL) {
if (!project->isScratchProject && [project->rootItems count] > 0) {
// Pull the project directory from the first root item
NSDictionary *firstItem = [project->rootItems objectAtIndex:0];
if ([project->rootItems count] == 1) {
projectDir = [firstItem valueForKey:@"sourceDirectory"];
projectDir = [firstItem valueForKey:@"sourceDirectory"];
} else {
projectDir = [[firstItem valueForKey:@"sourceDirectory"] stringByDeletingLastPathComponent];
}
}
if (NULL == projectDir)
Expand Down

0 comments on commit 908953f

Please sign in to comment.