     @setActiveTab(@tabForItem(@pane.activeItem))
 
   closeTab: (tab) ->
-    if tab is true then tab = @children('.right-clicked').view()
+    tab ?= @children('.right-clicked').view()
     @pane.destroyItem(tab.item)
 
   closeOtherTabs: ->

        @pane.trigger('application:new-file')
        false

    @on 'click', '.tab .close-icon', (e) =>
      tab = $(e.target).closest('.tab').view()
      @pane.destroyItem(tab.item)
      false



    @updateActiveTab()

    @on 'mousedown', '.tab', ({target, which, ctrlKey}) =>
      tab = $(target).closest('.tab')
      view = tab.view()
      if which is 3 or (which is 1 and ctrlKey is true)
        @find('.right-clicked').removeClass('right-clicked')
        tab.addClass('right-clicked')
      else if which is 1 and not target.classList.contains('close-icon')
        @pane.showItem(view.item)
        @pane.focus()

