Let the bundle item chooser handle “option return to edit”

Previously using option return would only work for editing bundle items, not key binding files.
This commit is contained in:
Allan Odgaard
2016-09-08 22:47:30 +02:00
parent 0c71b54a9e
commit eba19a8fe2
2 changed files with 4 additions and 5 deletions

View File

@@ -445,11 +445,7 @@ BOOL HasDocumentWindow (NSArray* windows)
- (void)bundleItemChooserDidSelectItems:(id)sender
{
for(NSDictionary* item in [sender selectedItems])
{
if(OakIsAlternateKeyOrMouseEvent())
[[BundleEditor sharedInstance] revealBundleItem:bundles::lookup(to_s([item objectForKey:@"uuid"]))];
else [NSApp sendAction:@selector(performBundleItemWithUUIDString:) to:nil from:[item objectForKey:@"uuid"]];
}
[NSApp sendAction:@selector(performBundleItemWithUUIDString:) to:nil from:[item objectForKey:@"uuid"]];
}
// ===========================

View File

@@ -887,6 +887,9 @@ static std::vector<bundles::item_ptr> relevant_items_in_scope (scope::context_t
- (void)accept:(id)sender
{
if(self.canEdit && OakIsAlternateKeyOrMouseEvent())
return [self editItem:sender];
if(_bundleItemField == kBundleItemTitleField && OakNotEmptyString(self.filterString) && (self.tableView.selectedRow > 0 || [self.filterString length] > 1))
{
NSDictionary* item = self.items[self.tableView.selectedRow];