mirror of
https://github.com/textmate/textmate.git
synced 2026-01-21 04:38:13 -05:00
Add delete action to Open Favorites
This only works for Recent Projects (not Favorites). Also, the key equivalent for this is ⌘⌫. The Edit → Delete menu item will not work (as it’s being sent to the input field).
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
#import <OakFilterList/OakAbbreviations.h>
|
||||
#import <OakAppKit/OakUIConstructionFunctions.h>
|
||||
#import <OakAppKit/OakScopeBarView.h>
|
||||
#import <OakAppKit/OakSound.h>
|
||||
#import <OakFoundation/NSString Additions.h>
|
||||
#import <OakSystem/application.h>
|
||||
#import <text/ranker.h>
|
||||
@@ -223,6 +224,29 @@ static NSUInteger const kOakSourceIndexFavorites = 1;
|
||||
[super accept:sender];
|
||||
}
|
||||
|
||||
- (void)delete:(id)sender
|
||||
{
|
||||
NSArray* items = self.selectedItems;
|
||||
if(!items.count)
|
||||
return;
|
||||
|
||||
for(NSDictionary* item in items)
|
||||
{
|
||||
NSString* path = item[@"path"];
|
||||
if(self.sourceIndex == kOakSourceIndexRecentProjects)
|
||||
{
|
||||
KVDB* db = [self sharedProjectStateDB];
|
||||
[db removeObjectForKey:path];
|
||||
}
|
||||
else if(self.sourceIndex == kOakSourceIndexFavorites)
|
||||
{
|
||||
NSLog(@"%s %@", sel_getName(_cmd), path);
|
||||
}
|
||||
}
|
||||
[self loadItems:self];
|
||||
OakPlayUISound(OakSoundDidTrashItemUISound);
|
||||
}
|
||||
|
||||
- (void)takeSourceIndexFrom:(id)sender
|
||||
{
|
||||
if([sender respondsToSelector:@selector(tag)])
|
||||
|
||||
Reference in New Issue
Block a user