mirror of
https://github.com/textmate/textmate.git
synced 2026-04-28 03:00:34 -04:00
Moving focus to file browser now select first item
This is only when using the special Navigate → Move Focus to File Browser (⌥⌘⇥) command and is mainly because there is no other visual feedback (other than the text view being rendered in its inactive state). I could see sometimes not wanting a selection in the file browser, this however seems like a general problem (i.e. the solution should likely be to introduce a way to “deselect all”).
This commit is contained in:
@@ -311,7 +311,18 @@ namespace
|
||||
if([self.window firstResponder] == self.textView)
|
||||
{
|
||||
self.fileBrowserVisible = YES;
|
||||
[self.window makeFirstResponder:self.fileBrowser.outlineView];
|
||||
NSOutlineView* outlineView = self.fileBrowser.outlineView;
|
||||
[self.window makeFirstResponder:outlineView];
|
||||
if([outlineView numberOfSelectedRows] == 0)
|
||||
{
|
||||
for(NSUInteger row = 0; row < [outlineView numberOfRows]; ++row)
|
||||
{
|
||||
if([[outlineView delegate] respondsToSelector:@selector(outlineView:isGroupItem:)] && [[outlineView delegate] outlineView:outlineView isGroupItem:[outlineView itemAtRow:row]])
|
||||
continue;
|
||||
[outlineView selectRowIndexes:[NSIndexSet indexSetWithIndex:row] byExtendingSelection:NO];
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user