mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Simplify code
If the window hadn’t been loaded yet, we previously had to delay opening the document when changing tab (in code). Since we now create the window in the initializer, there is no longer need for this.
This commit is contained in:
@@ -31,8 +31,6 @@ PUBLIC @interface DocumentController : NSWindowController <NSWindowDelegate, Oak
|
||||
OakHTMLOutputView* htmlOutputView;
|
||||
command::runner_ptr runner;
|
||||
|
||||
BOOL windowHasLoaded;
|
||||
|
||||
BOOL fileBrowserHidden;
|
||||
NSDictionary* fileBrowserState;
|
||||
|
||||
|
||||
@@ -415,7 +415,6 @@ OAK_DEBUG_VAR(DocumentController);
|
||||
layoutView.tabBarView = tabBarView;
|
||||
|
||||
[self windowDidLoad];
|
||||
[self windowDidBecomeMain:nil];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
@@ -544,15 +543,6 @@ OAK_DEBUG_VAR(DocumentController);
|
||||
self.isDocumentEdited = doc->is_modified();
|
||||
}
|
||||
|
||||
- (void)windowDidBecomeMain:(NSNotification*)aNotification
|
||||
{
|
||||
if(!windowHasLoaded)
|
||||
{
|
||||
windowHasLoaded = YES;
|
||||
self.selectedTabIndex = selectedTabIndex;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateProxyIcon
|
||||
{
|
||||
struct callback_t : scm::callback_t
|
||||
|
||||
@@ -37,8 +37,7 @@ namespace
|
||||
// This is also set after open succeeds
|
||||
[self synchronizeWindowTitle];
|
||||
|
||||
if(windowHasLoaded)
|
||||
[[DocumentOpenHelper new] tryOpenDocument:self.selectedDocument forWindow:self.window delegate:self];
|
||||
[[DocumentOpenHelper new] tryOpenDocument:self.selectedDocument forWindow:self.window delegate:self];
|
||||
}
|
||||
|
||||
- (document::document_ptr const&)selectedDocument
|
||||
|
||||
Reference in New Issue
Block a user