       'tabs:keep-preview-tab': => @clearPreviewTabs()
 
     @subscriptions.add atom.commands.add 'atom-workspace',
-      'tabs:close-tab': => @closeTab()
-      'tabs:close-other-tabs': => @closeOtherTabs()
-      'tabs:close-tabs-to-right': => @closeTabsToRight()
+      'tabs:close-tab': => @closeTab(@getActiveTab())
+      'tabs:close-other-tabs': => @closeOtherTabs(@getActiveTab())
+      'tabs:close-tabs-to-right': => @closeTabsToRight(@getActiveTab())
       'tabs:close-saved-tabs': => @closeSavedTabs()
       'tabs:close-all-tabs': => @closeAllTabs()
 

  copyItem: (item) ->
    item.copy?() ? atom.deserializers.deserialize(item.serialize())

  closeOtherTabs: ->
    tabs = @getTabs()
    active = @children('.right-clicked')[0]
    active ?= @tabForItem(@pane.getActiveItem())
    return unless active?
    @closeTab tab for tab in tabs when tab isnt active

  closeTabsToRight: ->
    tabs = @getTabs()
    active = @children('.right-clicked')[0]
    active ?= @tabForItem(@pane.getActiveItem())
    index = tabs.indexOf(active)
    return if index is -1
    @closeTab tab for tab, i in tabs when i > index

      @element.querySelector('.tab.active')?.classList.remove('active')
      tabView.classList.add('active')

  getActiveTab: ->
    @tabForItem(@pane.getActiveItem())

  updateActiveTab: ->
    @setActiveTab(@tabForItem(@pane.getActiveItem()))

  closeTab: (tab) ->
    tab ?= @children('.right-clicked')[0]
    @pane.destroyItem(tab.item) if tab?

  splitTab: (fn) ->
