mirror of
https://github.com/textmate/textmate.git
synced 2026-01-15 01:38:02 -05:00
Allow closing tabs on “other” (middle) mouse button
This commit is contained in:
@@ -556,6 +556,11 @@ static NSString* const OakTabItemPasteboardType = @"OakTabItemPasteboardType";
|
||||
[self trySelectTabForView:[self hitTest:mouseCurrentPos]];
|
||||
}
|
||||
|
||||
- (void)otherMouseUp:(NSEvent*)anEvent
|
||||
{
|
||||
[self _performCloseTab:[self hitTest:[[self superview] convertPoint:[anEvent locationInWindow] fromView:nil]]];
|
||||
}
|
||||
|
||||
- (void)trySelectTabForView:(NSView*)aView
|
||||
{
|
||||
if(OakTabItem* tabItem = [self tabItemForView:aView])
|
||||
@@ -783,7 +788,7 @@ static NSString* const OakTabItemPasteboardType = @"OakTabItemPasteboardType";
|
||||
_tag = [_tabItems indexOfObject:tabItem]; // performCloseTab: asks for [sender tag]
|
||||
|
||||
BOOL closeOther = OakIsAlternateKeyOrMouseEvent();
|
||||
if(_isMouseInside && [[NSApp currentEvent] type] == NSLeftMouseUp && !closeOther && tabItem != _overflowTabItem)
|
||||
if(_isMouseInside && ([[NSApp currentEvent] type] == NSLeftMouseUp || [[NSApp currentEvent] type] == NSOtherMouseUp) && !closeOther && tabItem != _overflowTabItem)
|
||||
{
|
||||
_didCloseTabIndex = _tag;
|
||||
_didCloseTabFrame = tabItem.targetFrame;
|
||||
|
||||
Reference in New Issue
Block a user