mirror of
https://github.com/textmate/textmate.git
synced 2026-02-13 16:05:03 -05:00
Revert "Use current document when no URL given in txmt URL"
Pending improved implementation which also handle the case where frontmost document is untitled.
This reverts commit 2beac7080b.
This commit is contained in:
@@ -83,7 +83,6 @@ static NSString* const OakGlobalSessionInfo = @"OakGlobalSessionInfo";
|
||||
{
|
||||
std::map<std::string, std::string> parameters;
|
||||
|
||||
BOOL hadURL = NO;
|
||||
NSArray* components = [[aURL query] componentsSeparatedByString:@"&"];
|
||||
for(NSString* part in components)
|
||||
{
|
||||
@@ -93,19 +92,6 @@ static NSString* const OakGlobalSessionInfo = @"OakGlobalSessionInfo";
|
||||
std::string key = to_s([[keyValue firstObject] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]);
|
||||
NSURL* fileURL = key == "url" ? [NSURL URLWithString:[keyValue lastObject]] : nil;
|
||||
parameters[key] = to_s([fileURL isFileURL] ? [fileURL path] : [[keyValue lastObject] stringByReplacingPercentEscapesUsingEncoding:NSUTF8StringEncoding]);
|
||||
hadURL |= (key == "url");
|
||||
}
|
||||
}
|
||||
|
||||
if(!hadURL && [[NSApp orderedWindows]count] > 0)
|
||||
{
|
||||
NSWindow* window=[[NSApp orderedWindows]objectAtIndex:0];
|
||||
DocumentController* controller = (DocumentController*)[window delegate];
|
||||
if([controller isKindOfClass:[DocumentController class]] && !controller->documentTabs.empty())
|
||||
{
|
||||
NSString* path=[controller documentFilePath];
|
||||
|
||||
if(path && [path length] > 0) parameters["url"] = to_s(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user