 
     return null
 
-  # INDENT CREATE/DESTROY SUPPORT
-  # ================================
-
-  ###
-  # CreateIndent undo operation
-  class CreateIndentOperation extends UndoOperation
-    constructor: (pos, @depth) ->
-      @location = pos.getSerializedLocation()
-
-    undo: (editor) ->
-      indent = editor.tree.getTokenAtLocation(@location).indent
-      indent.start.prev.append indent.end.next; indent.notifyChange()
-
-    redo: (editor) ->
-      head = editor.tree.getTokenAtLocation(@location)
-
-      newIndent = new model.Indent DEFAULT_INDENT_DEPTH
-      head.prev.append(newIndent.start)
-               .append(new model.NewlineToken())
-               .append(newIndent.end)
-               .append(head)
-
-  # DestroyIndent undo operation
-  class DestroyIndentOperation extends UndoOperation
-    constructor: (indent) ->
-      @location = indent.start.getSerializedLocation()
-      @indent = indent.clone()
-
-    undo: (editor) ->
-      head = editor.tree.getTokenAtLocation(@location)
-
-      newIndent = @indent.clone()
-      head.prev.append newIndent.start
-      newIndent.end.append head
-
-      newIndent.notifyChange()
-
-    redo: (editor) ->
-      indent = editor.tree.getTokenAtLocation(@location).indent
-      indent.start.prev.append indent.end.next; indent.notifyChange()
-
-  # If we press tab while we are editing
-  # a handwritten block, we create and indent.
-  hook 'key.tab', 0, ->
-    if @textFocus? and @textFocus.handwritten
-      @addMicroUndoOperation 'CAPTURE_POINT'
-
-      # Seek the block directly before this
-      head = @textFocus.start
-      until head.type is 'blockEnd'
-        head = head.prev
-
-      # If it ends in an indent,
-      # move this block to that indent.
-      if head.prev.type is 'indentEnd'
-        until head.type in ['blockEnd', 'indentStart']
-          head = head.prev
-
-      # Otherwise, create an indent right before this.
-      else
-        @addMicroUndoOperation new CreateIndentOperation head, DEFAULT_INDENT_DEPTH
-
-        newIndent = new model.Indent DEFAULT_INDENT_DEPTH
-        newIndent.start.append(new model.NewlineToken()).append newIndent.end
-        newIndent.spliceIn head.prev
-        newIndent.notifyChange()
-
-        head = newIndent.start
-
-      # Go through the motions of moving this block into
-      # the indent we have just found.
-      @addMicroUndoOperation new PickUpOperation @textFocus.start.prev.container
-      @textFocus.start.prev.container.spliceOut() #MUTATION
-
-      @addMicroUndoOperation new DropOperation @textFocus.start.prev.container, head
-      @textFocus.start.prev.container.spliceIn head #MUTATION
-
-      # Move the cursor up to where the block now is.
-      @moveCursorTo @textFocus.start.prev.container.end
-
-      @redrawMain()
-
-  # If we press backspace at the start of an empty
-  # indent (an indent containing only whitespace),
-  # delete that indent.
-  hook 'key.backspace', 0, (state) ->
-    if state.capturedBackspace then return
-
-    if  not @textFocus? and
-        @cursor.prev?.prev?.type is 'indentStart' and
-        (indent = @cursor.prev.prev.indent).stringify().trim().length is 0
-
-      @addMicroUndoOperation new DestroyIndentOperation indent
-      indent.notifyChange()
-
-      indent.start.prev.append indent.end.next #MUTATION
-
-      @moveCursorTo indent.end.next
-
-      state.capturedBackspace = true
-
-      @redrawMain()
-  ###
-
   # ANIMATION AND ACE EDITOR SUPPORT
   # ================================
 

  # ================================

  hook 'populate', 0, ->
    @cursor = new model.CursorToken()

  # A cursor cannot be inside only a block.
  # Convenience function for this validation:
  isValidCursorPosition = (pos) ->
    return pos.parent.type in ['indent', 'segment']

  # A cursor is only allowed to be on a line.
  Editor::moveCursorTo = (destination, attemptReparse = false) ->

      # ## Document initialization
      # We start of with an empty document
      @tree = new model.Segment()
      @cursor = @tree.start

      @resize()

