mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Opening folder after session restore would not see it as open
When opening a folder we test against the ‘projectPath’ property (on already open window controllers), but this is not setup until we have an open document, and documents are opened using a background queue, so code running in the same event loop cycle as the session restore, will not get the proper value for this property. The problem this fixes is: open /path/to/foo and quit TextMate. Now drag /path/to/foo to TextMate’s app icon. TextMate would first restore session (which includes /path/to/foo) and then open /path/to/foo (not seeing the restored folder as being /path/to/foo due to the uninitialized ‘projectPath’ property).
This commit is contained in:
@@ -2698,7 +2698,7 @@ static NSUInteger DisableSessionSavingCount = 0;
|
||||
|
||||
for(DocumentController* candidate in SortedControllers())
|
||||
{
|
||||
if(folder == to_s(candidate.projectPath))
|
||||
if(folder == to_s(candidate.projectPath ?: candidate.defaultProjectPath))
|
||||
return bring_to_front(candidate);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user