   getSelectionRange: ->
     range = @editor.getSelection().getBufferRange()
     return {
-      start: @editor.activeEditSession.indexForBufferPosition(range.start),
-      end: @editor.activeEditSession.indexForBufferPosition(range.end)
+      start: @editSession.indexForBufferPosition(range.start),
+      end: @editSession.indexForBufferPosition(range.end)
     }
 
   # Creates a selection from the `start` to `end` character indexes.

  # end - A {Number} representing the ending character index
  createSelection: (start, end) ->
    @editor.getSelection().setBufferRange
      start: @editor.indexForBufferPosition(start)
      end: @editor.indexForBufferPosition(end)

  # Fetches the current line's start and end indexes.
  #

        start: value.length + start
        end: value.length + start

    range = @editor.getSelection().getBufferRange()
    range.start = Point.fromObject(@editSession.bufferPositionForIndex(start))
    range.end = Point.fromObject(@editSession.bufferPositionForIndex(end))

    @editor.setTextInRange(range, value)

    range.start = Point.fromObject(@editSession.bufferPositionForIndex(firstTabStop.start))
    range.end = Point.fromObject(@editSession.bufferPositionForIndex(firstTabStop.end))

    @editor.getSelection().setBufferRange(range)

  # Returns the editor content.
