Inline deselectExtension code in OakSavePanel

The code is tweaked a bit compared to the category method we inlined.
This commit is contained in:
Allan Odgaard
2013-01-24 15:20:34 +01:00
parent a7a6f29f3f
commit fe08871c45

View File

@@ -80,6 +80,14 @@
NSString* path = result == NSOKButton ? [[savePanel.URL filePathURL] path] : nil;
aCompletionHandler(path, optionsViewController.encodingOptions);
}];
[savePanel deselectExtension];
// Deselect Extension
if([savePanel.firstResponder isKindOfClass:[NSTextView class]])
{
NSTextView* tw = (NSTextView*)savePanel.firstResponder;
NSRange extRange = [tw.textStorage.string rangeOfString:@"."];
if(extRange.location != NSNotFound)
[tw setSelectedRange:NSMakeRange(0, extRange.location)];
}
}
@end