diff options
Diffstat (limited to 'Source/SPAppController.m')
-rw-r--r-- | Source/SPAppController.m | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/Source/SPAppController.m b/Source/SPAppController.m index b34cb0d5..ae42d254 100644 --- a/Source/SPAppController.m +++ b/Source/SPAppController.m @@ -723,8 +723,21 @@ } else if([action isEqualToString:SPBundleOutputActionShowAsHTML]) { - SPBundleHTMLOutputController *c = [[SPBundleHTMLOutputController alloc] init]; - [c displayHTMLContent:output withOptions:nil]; + BOOL correspondingWindowFound = NO; + for(id win in [NSApp windows]) { + if([[win delegate] isKindOfClass:[SPBundleHTMLOutputController class]]) { + if([[[win delegate] windowUUID] isEqualToString:[cmdData objectForKey:SPBundleFileUUIDKey]]) { + correspondingWindowFound = YES; + [[win delegate] displayHTMLContent:output withOptions:nil]; + break; + } + } + } + if(!correspondingWindowFound) { + SPBundleHTMLOutputController *c = [[SPBundleHTMLOutputController alloc] init]; + [c setWindowUUID:[cmdData objectForKey:SPBundleFileUUIDKey]]; + [c displayHTMLContent:output withOptions:nil]; + } } } } else { |