 
     pane.addSubView editor
     @tabView.addPane pane
+    @activeTabIndex = @tabView.panes.length
 
     pane.on "KDTabPaneDestroy", =>
       @workspaceRef.once "value", (snapshot) =>

    @tabView = new ApplicationTabView
      delegate           : @
      tabHandleContainer : @tabHandleContainer

  createEditorInstance: (file, content, sessionKey) ->
    if file

    @workspaceRef     = @workspace.firepadRef.child @sessionKey
    @isJoinedASession = @getOptions().sessionKey
    @openedFiles      = []
    @activeTabIndex   = 0

    log "joined an old session again, creating new tabbed editor" if @isJoinedASession

