     else
       @editor.clearSelection()
 
+  # undo the last `Command`
   undo: ->
     undoManager = @editor.session.getUndoManager()
     undoManager.jimUndo()
     @editor.clearSelection()
 
+  # see `JimUndoManager::lastInsert`
   lastInsert: -> @editor.session.getUndoManager().lastInsert()
 
+  ## getting the cursor's position in the document
   column:   -> @editor.selection.selectionLead.column
   row:      -> @editor.selection.selectionLead.row
   position: -> [@row(), @column()]
 
+  ## viewport-related methods
   firstFullyVisibleRow: -> @editor.renderer.getFirstFullyVisibleRow()
   lastFullyVisibleRow:  ->
     # Ace sometimes sees more rows then there are lines, this will

    else if prevMode?.name is 'replace'
      @markUndoPoint 'jim:replace:end'

  markUndoPoint: (markName) ->
    @editor.session.getUndoManager().execute args: [markName, @editor.session]

  setOverwriteMode: (active) -> @editor.setOverwrite active

  clearSelection: (beginning) ->
    if beginning and not @editor.selection.isBackwards()
      {row, column} = @editor.selection.getSelectionAnchor()

    else
      lastVisibleRow

  # Jim's block cursor is not considered by Ace to be part of the selection
  # unless the selection is backwards.  This makes the cursor part of the
  # selection.  Used just before the selection is acted upon, while an
  # `Operation` with a non-`exclusive` `Motion` is executing, for example.
  includeCursorInSelection: ->
    if not @editor.selection.isBackwards()
      @editor.selection.selectRight() unless beyondLineEnd(@editor)
