     if options?.adjustVerticalScrollbar ? true
       @verticalScrollbar.scrollTop(scrollTop)
 
-  # Internal:
   scrollBottom: (scrollBottom) ->
     if scrollBottom?
       @scrollTop(scrollBottom - @scrollView.height())
     else
       @scrollTop() + @scrollView.height()
 
+  ###
+  # Public #
+  ###
+
+  # Public: Retrieves the {EditSession}'s buffer.
+  #
+  # Returns the current {Buffer}.
+  getBuffer: -> @activeEditSession.buffer
+  
   # Public: Scrolls the editor to the bottom.
   scrollToBottom: ->
     @scrollBottom(@screenLineCount() * @lineHeight)


    @trigger 'editor:attached', [this]

  # Internal:
  edit: (editSession) ->
    return if editSession is @activeEditSession


  # iterator - A {Function} that's called on each match
  backwardsScanInBufferRange: (args...) -> @getBuffer().backwardsScanInRange(args...)

  ###
  # Internal #
  ###

  configure: ->
    @observeConfig 'editor.showLineNumbers', (showLineNumbers) => @gutter.setShowLineNumbers(showLineNumbers)
    @observeConfig 'editor.showInvisibles', (showInvisibles) => @setShowInvisibles(showInvisibles)
