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


    @highlightFlashShow()

    # Otherwise, splice the cursor out.
    @cursor.remove()

    # If the destination is in the tree,
    # figure out where we want to place the cursor.

    # We can place the cursor
    # at the start of the tree
    if destination is @tree.start
      destination.insert @cursor

    # If we got some other token,
    # scan forward until we find

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

  hook 'populate', 0, ->
    @cursor = null

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

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