mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Do not re-use closed HTML output windows
This commit is contained in:
@@ -46,18 +46,25 @@ static std::multimap<oak::uuid_t, HTMLOutputWindowController*> Windows;
|
||||
|
||||
+ (HTMLOutputWindowController*)HTMLOutputWindowWithRunner:(command::runner_ptr const&)aRunner
|
||||
{
|
||||
D(DBF_HTMLOutputWindow, bug("%s\n", to_s(aRunner->uuid()).c_str()););
|
||||
foreach(it, Windows.lower_bound(aRunner->uuid()), Windows.upper_bound(aRunner->uuid()))
|
||||
{
|
||||
HTMLOutputWindowController* controller = it->second;
|
||||
if(![controller running])
|
||||
{
|
||||
D(DBF_HTMLOutputWindow, bug("found existing controller\n"););
|
||||
return [controller setCommandRunner:aRunner], controller;
|
||||
}
|
||||
}
|
||||
|
||||
for(NSWindow* window in [NSApp orderedWindows])
|
||||
{
|
||||
HTMLOutputWindowController* delegate = [window delegate];
|
||||
if(![window isMiniaturized] && [delegate isKindOfClass:[HTMLOutputWindowController class]])
|
||||
if(![window isMiniaturized] && [window isVisible] && [delegate isKindOfClass:[HTMLOutputWindowController class]])
|
||||
{
|
||||
D(DBF_HTMLOutputWindow, bug("found existing window\n"););
|
||||
return [delegate setCommandRunner:aRunner], delegate;
|
||||
}
|
||||
}
|
||||
|
||||
return [[self alloc] initWithRunner:aRunner];
|
||||
|
||||
Reference in New Issue
Block a user