       panelIndexInParent = parentSplitView.panels.indexOf parent
 
     splitView.once 'SplitIsBeingMerged', (views) =>
+      for view in views
+        index = @ideViews.indexOf view
+        @ideViews.splice index, 1
+
       @handleSplitMerge views, parent, parentSplitView, panelIndexInParent
 
     splitView.merge()

      ideView.tabView.addPane pane

    @setActiveTabView ideView.tabView

    if parentSplitView and panelIndexInParent
      parentSplitView.options.views[panelIndexInParent] = ideView


    appView   = @getView()
    workspace = @workspace = new Workspace { layoutOptions }
    @ideViews = []

    workspace.once 'ready', =>
      panel = workspace.getView()
      appView.addSubView panel

      panel.once 'viewAppended', =>
        ideView = panel.getPaneByName 'editorPane'
        @setActiveTabView ideView.tabView
        @ideViews.push ideView
        appView.emit 'KeyViewIsSet'

  setActiveTabView: (tabView) ->
