 
     @workspaceRef.onDisconnect().remove()  if @workspace.amIHost()
 
+  getActivePaneEditor: ->
+    return @editors[@getActivePaneIndex()] or null
+
   getActivePaneContent: ->
-    return @tabView.getActivePane().subViews[0].getValue()
+    return @getActivePaneEditor().getValue()
 
   getActivePaneFileData: ->
-    return @tabView.getActivePane().subViews[0].getData()
+    return @getActivePaneEditor().getData()
 
   getActivePane: ->
     return @tabView.getActivePane()
+
+  getActivePaneIndex: ->
+    return @tabView.getPaneIndex @getActivePane()
 
   createEditorTabs: ->
     @tabHandleContainer = new ApplicationTabHandleHolder

    @workspaceRef.child("tabs").push workspaceRefData  unless sessionKey

    pane.on "KDTabPaneDestroy", =>
      @workspaceRef.once "value", (snapshot) =>
        {tabs} = snapshot.val()
        return unless tabs

    }

    pane.addSubView editor
    @editors.push editor
    @tabView.addPane pane
    @activeTabIndex = @tabView.panes.length

