To open document in new project the null UUID must be used

Previously when providing a project UUID while opening a document, and no project used this UUID, TextMate would create a new project (with this UUID).

This was both a way to force a file to open in its own project, and to open multiple files in the same project, even though they did not share project folder.

The problem is that `mate` will read the `TM_PROJECT_UUID` environment variable and use as target project, which is generally desired, but incase we launch a new application from TextMate, and this application later opens a file via `mate`, it will use the old `TM_PROJECT_UUID` value, which might no longer exist.

We still allow forcing files to open in their own project by introducing a special “null UUID”, but with this change, it is no longer possible to use multiple invocations of `mate` to open unrelated files in the same project. Should this be desired, we can re-introduce this feature but require that `mate` is given the UUID via its -p/--project argument.

Fixes textmate/latex.tmbundle#150
This commit is contained in:
Allan Odgaard
2016-05-09 16:28:34 +02:00
parent 0ca13d8f25
commit 17ea3ec568

View File

@@ -2695,9 +2695,8 @@ static NSUInteger DisableSessionSavingCount = 0;
if(DocumentController* res = AllControllers()[[NSString stringWithCxxString:projectUUID]])
return res;
DocumentController* res = [DocumentController new];
res.identifier = [NSString stringWithCxxString:projectUUID];
return res;
if(projectUUID == "00000000-0000-0000-0000-000000000000")
return [DocumentController new];
}
// =========================================