mirror of
https://github.com/textmate/textmate.git
synced 2026-01-20 20:27:59 -05:00
Only skip setting search folder for ⇧⌘F if already “owner”
The user may use ⇧⌘F either to bring existing results to front, or to start a new folder search for a potential different project. If the dialog is not visible, we always initialize it fully. If already visible, we previously would not setup search folder since the current search folder might have been manually set by the user, which we do not want to overwrite.
This commit is contained in:
@@ -1778,6 +1778,7 @@ namespace
|
||||
- (IBAction)orderFrontFindPanel:(id)sender
|
||||
{
|
||||
Find* find = [Find sharedInstance];
|
||||
BOOL didOwnDialog = [find.projectIdentifier isEqualToString:self.identifier];
|
||||
find.documentIdentifier = self.selectedDocumentUUID;
|
||||
find.projectFolder = self.projectPath ?: self.untitledSavePath ?: NSHomeDirectory();
|
||||
find.projectIdentifier = self.identifier;
|
||||
@@ -1796,7 +1797,7 @@ namespace
|
||||
{
|
||||
BOOL fileBrowserHasFocus = [self.window.firstResponder respondsToSelector:@selector(isDescendantOf:)] && [(NSView*)self.window.firstResponder isDescendantOf:self.fileBrowser.view];
|
||||
NSString* searchFolder = fileBrowserHasFocus ? self.untitledSavePath : find.projectFolder;
|
||||
if(find.isVisible && find.searchFolder)
|
||||
if(find.isVisible && find.searchFolder && didOwnDialog) // don’t reset search folder, as the user may have picked “Other…” and simply wants the results brought to front
|
||||
searchFolder = find.searchFolder;
|
||||
[find showFindWindowFor:searchFolder];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user