mirror of
https://github.com/textmate/textmate.git
synced 2026-01-21 04:38:13 -05:00
Change criterion for focusing find string when dialog is open
We now move focus to the find string unless the window is visible, key, and focus is already in a text field (technically an NSTextView).
This commit is contained in:
@@ -525,9 +525,9 @@ static NSButton* OakCreateButton (NSString* label, NSBezelStyle bezel = NSRounde
|
||||
|
||||
- (void)showWindow:(id)sender
|
||||
{
|
||||
BOOL isVisible = [self isWindowLoaded] && [self.window isVisible];
|
||||
BOOL isVisibleAndKey = [self isWindowLoaded] && [self.window isVisible] && [self.window isKeyWindow];
|
||||
[super showWindow:sender];
|
||||
if(!isVisible)
|
||||
if(!isVisibleAndKey || ![[self.window firstResponder] isKindOfClass:[NSTextView class]])
|
||||
[self.window makeFirstResponder:self.findTextField];
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user