mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Fix wrong document showing after session restore
Since documents are loaded asynchronously and we trigger a request for the first tab’s document, this might finish loading after the selected tab’s document, hence trigger a setDocument: after we loaded the selected document’s tab.
This commit is contained in:
@@ -259,6 +259,10 @@ namespace
|
||||
|
||||
- (void)documentOpenHelper:(DocumentOpenHelper*)documentOpenHelper didOpenDocument:(document::document_ptr const&)aDocument
|
||||
{
|
||||
[documentOpenHelper autorelease];
|
||||
if(aDocument != [self selectedDocument])
|
||||
return;
|
||||
|
||||
iterate(tab, documentTabs)
|
||||
{
|
||||
if(**tab == aDocument && !(*tab)->_did_open)
|
||||
@@ -273,7 +277,6 @@ namespace
|
||||
[documentView setDocument:aDocument];
|
||||
[self makeTextViewFirstResponder:self];
|
||||
|
||||
[documentOpenHelper release];
|
||||
}
|
||||
|
||||
- (void)documentOpenHelper:(DocumentOpenHelper*)documentOpenHelper failedToOpenDocument:(document::document_ptr const&)aDocument error:(std::string const&)aMessage usingFilter:(oak::uuid_t const&)filterUUID
|
||||
|
||||
Reference in New Issue
Block a user