mirror of
https://github.com/textmate/textmate.git
synced 2026-01-14 09:18:07 -05:00
Bind Go to Tab → Last Tab to ⌘9 instead of ⌘0
Also avoid binding to ⌘0 in all other ⌘1-n contexts. This frees up ⌘0 to “Reset Font Size”.
This commit is contained in:
@@ -2264,7 +2264,7 @@ namespace
|
||||
int i = 0;
|
||||
for(auto document : _documents)
|
||||
{
|
||||
NSMenuItem* item = [aMenu addItemWithTitle:[NSString stringWithCxxString:document->display_name()] action:@selector(takeSelectedTabIndexFrom:) keyEquivalent:i < 9 ? [NSString stringWithFormat:@"%c", '0' + ((i+1) % 10)] : @""];
|
||||
NSMenuItem* item = [aMenu addItemWithTitle:[NSString stringWithCxxString:document->display_name()] action:@selector(takeSelectedTabIndexFrom:) keyEquivalent:i < 8 ? [NSString stringWithFormat:@"%c", '1' + i] : @""];
|
||||
item.tag = i;
|
||||
item.toolTip = [[NSString stringWithCxxString:document->path()] stringByAbbreviatingWithTildeInPath];
|
||||
item.image = [OakFileIconImage fileIconImageWithPath:[NSString stringWithCxxString:document->path()] isModified:document->is_modified()];
|
||||
@@ -2283,7 +2283,7 @@ namespace
|
||||
{
|
||||
[aMenu addItem:[NSMenuItem separatorItem]];
|
||||
|
||||
NSMenuItem* item = [aMenu addItemWithTitle:@"Last Tab" action:@selector(takeSelectedTabIndexFrom:) keyEquivalent:@"0"];
|
||||
NSMenuItem* item = [aMenu addItemWithTitle:@"Last Tab" action:@selector(takeSelectedTabIndexFrom:) keyEquivalent:@"9"];
|
||||
item.tag = _documents.size()-1;
|
||||
item.toolTip = [NSString stringWithCxxString:_documents.back()->display_name()];
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ NSString* const FFFindWasTriggeredByEnter = @"FFFindWasTriggeredByEnter";
|
||||
{
|
||||
if(document::document_ptr doc = parent.document)
|
||||
{
|
||||
NSMenuItem* item = [aMenu addItemWithTitle:[NSString stringWithCxxString:doc->path() == NULL_STR ? doc->display_name() : path::relative_to(doc->path(), to_s(self.searchFolder))] action:@selector(takeSelectedPathFrom:) keyEquivalent:key < 10 ? [NSString stringWithFormat:@"%c", '0' + (++key % 10)] : @""];
|
||||
NSMenuItem* item = [aMenu addItemWithTitle:[NSString stringWithCxxString:doc->path() == NULL_STR ? doc->display_name() : path::relative_to(doc->path(), to_s(self.searchFolder))] action:@selector(takeSelectedPathFrom:) keyEquivalent:key < 9 ? [NSString stringWithFormat:@"%c", '0' + (++key % 10)] : @""];
|
||||
[item setImage:parent.icon];
|
||||
[item setRepresentedObject:parent];
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ OAK_DEBUG_VAR(OakSubmenuController);
|
||||
return NO;
|
||||
|
||||
std::string const eventString = to_s(anEvent);
|
||||
if(eventString < "@0" || "@9" < eventString)
|
||||
if(eventString < "@1" || "@9" < eventString)
|
||||
return NO;
|
||||
|
||||
NSMenu* dummy = [NSMenu new];
|
||||
|
||||
@@ -337,7 +337,7 @@ static std::vector<bundles::item_ptr> relevant_items_in_scope (scope::context_t
|
||||
}
|
||||
|
||||
[actionMenu addItem:[NSMenuItem separatorItem]];
|
||||
[actionMenu addItemWithTitle:@"Search All Scopes" action:@selector(toggleSearchAllScopes:) keyEquivalent:key < 10 ? [NSString stringWithFormat:@"%c", '0' + (++key % 10)] : @""];
|
||||
[actionMenu addItemWithTitle:@"Search All Scopes" action:@selector(toggleSearchAllScopes:) keyEquivalent:key < 9 ? [NSString stringWithFormat:@"%c", '0' + (++key % 10)] : @""];
|
||||
|
||||
self.aboveScopeBarDark = OakCreateHorizontalLine([NSColor grayColor], [NSColor lightGrayColor]);
|
||||
self.aboveScopeBarLight = OakCreateHorizontalLine([NSColor colorWithCalibratedWhite:0.797 alpha:1], [NSColor colorWithCalibratedWhite:0.912 alpha:1]);
|
||||
|
||||
@@ -77,7 +77,7 @@ OAK_DEBUG_VAR(Preferences);
|
||||
int i = 0;
|
||||
for(NSViewController <MASPreferencesViewController>* viewController in _viewControllers)
|
||||
{
|
||||
NSMenuItem* item = [aMenu addItemWithTitle:viewController.toolbarItemLabel action:@selector(takeSelectedViewControllerIndexFrom:) keyEquivalent:i < 10 ? [NSString stringWithFormat:@"%c", '0' + ((i+1) % 10)] : @""];
|
||||
NSMenuItem* item = [aMenu addItemWithTitle:viewController.toolbarItemLabel action:@selector(takeSelectedViewControllerIndexFrom:) keyEquivalent:i < 9 ? [NSString stringWithFormat:@"%c", '1' + i] : @""];
|
||||
item.tag = i;
|
||||
item.target = self;
|
||||
if([viewController.identifier isEqualToString:selectedIdentifier])
|
||||
|
||||
Reference in New Issue
Block a user