From 7a6ea1dfac705ae5a7656c3de50301fd79d2d303 Mon Sep 17 00:00:00 2001 From: Chris Wanstrath Date: Thu, 8 Sep 2011 02:23:08 -0700 Subject: [PATCH] =?UTF-8?q?keymap=20for=20tabs.=20=E2=8C=98-Shift-[,=20?= =?UTF-8?q?=E2=8C=98-Shift-],=20=E2=8C=98-1,=20=E2=8C=98-2,=20etc?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/tabs/tabs.coffee | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/plugins/tabs/tabs.coffee b/plugins/tabs/tabs.coffee index 72990ff9f..11095f1a0 100644 --- a/plugins/tabs/tabs.coffee +++ b/plugins/tabs/tabs.coffee @@ -14,6 +14,17 @@ class Tabs extends Pane keymap: 'Command-W': 'closeActiveTab' + 'Command-Shift-[': 'prevTab' + 'Command-Shift-]': 'nextTab' + 'Command-1': -> @switchToTab 1 + 'Command-2': -> @switchToTab 2 + 'Command-3': -> @switchToTab 3 + 'Command-4': -> @switchToTab 4 + 'Command-5': -> @switchToTab 5 + 'Command-6': -> @switchToTab 6 + 'Command-7': -> @switchToTab 7 + 'Command-8': -> @switchToTab 8 + 'Command-9': -> @switchToTab 9 initialize: -> @editor = activeWindow.document @@ -55,6 +66,12 @@ class Tabs extends Pane $('#tabs').parents('.pane').remove() $('#tabs-style').remove() + nextTab: -> + @switchToTab $('#tabs ul .active').next() + + prevTab: -> + @switchToTab $('#tabs ul .active').prev() + showTabs: -> activeWindow.addPane this $('#tabs').parents('.pane').css height: 'inherit' @@ -62,6 +79,8 @@ class Tabs extends Pane $('head').append css switchToTab: (tab) -> + tab = $('#tabs ul li').get(tab - 1) if _.isNumber tab + return if tab.length is 0 $('#tabs ul .active').removeClass() $(tab).addClass 'active' @editor.switchToSession $(tab).data 'path'