     @scrollTop(@activeEditSession.scrollTop ? 0)
     @scrollView.scrollLeft(@activeEditSession.scrollLeft ? 0)
 
-  saveCurrentEditSession: ->
+  saveActiveEditSession: ->
     @activeEditSession.setCursorScreenPosition(@getCursorScreenPosition())
     @activeEditSession.setScrollTop(@scrollTop())
     @activeEditSession.setScrollLeft(@scrollView.scrollLeft())

      @setBuffer(new Buffer)

  serialize: ->
    @saveCurrentEditSession()
    { viewClass: "Editor", editSessions: @serializeEditSessions(), @activeEditSessionIndex, @isFocused }

  serializeEditSessions: ->

  setActiveEditSessionIndex: (index) ->
    throw new Error("Edit session not found") unless @editSessions[index]

    @saveActiveEditSession() if @activeEditSession

    @activeEditSession = @editSessions[index]
    @activeEditSessionIndex = index
