Do not open an external editor if an in-window is requested.

This commit is contained in:
Riccardo Mottola 2021-02-03 22:16:32 +01:00
parent eb5837315c
commit 1541788856
2 changed files with 12 additions and 3 deletions

View file

@ -1,3 +1,8 @@
2021-02-03 Riccardo Mottola <rm@gnu.org>
* Framework/PCEditorManager.m:
Do not open an external editor if an in-window is requested.
2020-09-08 Riccardo Mottola <rm@gnu.org>
* Modules/Editors/ProjectCenter/SyntaxHighlighter.h

View file

@ -170,7 +170,7 @@ NSString *PCEditorDidResignActiveNotification =
id<CodeParser> parser;
BOOL exists = [fm fileExistsAtPath:filePath isDirectory:&isDir];
// Determine if file not exist or file is directory
// Determine if file does not exist or file is directory
if (!exists)
{
NSRunAlertPanel(@"Open Editor",
@ -198,10 +198,14 @@ NSString *PCEditorDidResignActiveNotification =
else
{
NSString *app;
/* we don't have in-window editors for any bundles right now */
if (!windowed)
return;
/* Check for bundles and if possible let them be opened by Workspace */
/* Check for bundles and if possible let them be opened by Workspace but only if windowed */
app = [[NSWorkspace sharedWorkspace] getBestAppInRole:@"Editor" forExtension:[fileName pathExtension]];
if (app)
if (windowed && app != nil)
{
if ([[NSWorkspace sharedWorkspace] openFile: filePath])
return nil;