diff --git a/ChangeLog b/ChangeLog index bc8a5d1..ae620a1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,9 @@ * Framework/PCProjectEditor.m Re-enable wrongly uncommented statement. + * Framework/PCEditorManager.m + If we have a directory, we check if it is a bundle that an app can open it and open it through NSWorkspace. + 2015-06-12 Riccardo Mottola * Modules/Editors/ProjectCenter/PCEditor.m diff --git a/Framework/PCEditorManager.m b/Framework/PCEditorManager.m index 834c9d2..0d4ca05 100644 --- a/Framework/PCEditorManager.m +++ b/Framework/PCEditorManager.m @@ -191,15 +191,27 @@ NSString *PCEditorDidResignActiveNotification = @"Couldn't open editor for file '%@'.\n" @"File is not plain text.", @"Close", nil, nil, filePath);*/ + PCLogInfo(self, @"Not a text file %@", filePath); return nil; } } + else + { + NSString *app; + + /* Check for bundles and if possible let them be opened by Workspace */ + app = [[NSWorkspace sharedWorkspace] getBestAppInRole:@"Editor" forExtension:[fileName pathExtension]]; + if (app) + { + if ([[NSWorkspace sharedWorkspace] openFile: filePath]) + return nil; + } + } // NSLog(@"EditorManager 1: %@", _editorsDict); editor = [_editorsDict objectForKey: filePath]; if (editor == nil) { - NSLog(@"Opening new editor. Editor: %@", editorName); // Editor editor = [bundleManager objectForBundleWithName:editorName type:@"editor"