     @pre class: 'cursor', style: 'position: absolute;', => @raw '&nbsp;'
 
   viewProperties:
+    editor: ->
+      @parentView
+
     setBuffer: (@buffer) ->
       @buffer.on 'insert', (e) =>
         @setY(@getY() + e.string.length)
 
     setPosition: (point) ->
-      @point = @parentView.clipPosition(point)
+      @point = @editor().clipPosition(point)
       @goalY = null
       @updateAbsolutePosition()
 


    moveRight: ->
      { x, y } = @getPosition()
      if y < @parentView.buffer.getLine(x).length
        y++
      else if x < @parentView.buffer.numLines() - 1
        x++
        y = 0
      @setPosition({x, y})


    moveToLineEnd: ->
      { x } = @getPosition()
      @setPosition({ x, y: @editor().buffer.getLine(x).length })

    moveToLineStart: ->
      { x } = @getPosition()
