     atom.open({pathsToOpen: pathsToOpen, newWindow: true, devMode: atom.devMode, safeMode: atom.safeMode})
 
   splitTab: (fn) ->
-    if item = @querySelector('.right-clicked')?.item
+    if item = @rightClickedTab?.item
       if copiedItem = @copyItem(item)
         @pane[fn](items: [copiedItem])
 

    @setActiveTab(@tabForItem(@pane.getActiveItem()))

  closeTab: (tab) ->
    tab ?= @querySelector('.right-clicked')
    @pane.destroyItem(tab.item) if tab?

  openInNewWindow: (tab) ->
    tab ?= @querySelector('.right-clicked')
    item = tab?.item
    return unless item?
    if typeof item.getURI is 'function'


    tab = closest(event.target, '.tab')
    if event.which is 3 or (event.which is 1 and event.ctrlKey is true)
      @rightClickedTab?.classList.remove('right-clicked')
      @rightClickedTab = tab
      @rightClickedTab.classList.add('right-clicked')
      event.preventDefault()
    else if event.which is 1 and not event.target.classList.contains('close-icon')
      @pane.activateItem(tab.item)
