         else
           element.removeClass('fold-selected')
 
-  saveScrollPositionForeditor: ->
+  saveScrollPositionForEditor: ->
     if @attached
       @editor.setScrollTop(@scrollTop())
       @editor.setScrollLeft(@scrollLeft())

      @scrollRight(desiredRight)
    else if desiredLeft < @scrollLeft()
      @scrollLeft(desiredLeft)
    @saveScrollPositionForeditor()

  calculateDimensions: ->
    fragment = $('<div class="line" style="position: absolute; visibility: hidden;"><span>x</span></div>')

    return if editor is @editor

    if @editor
      @saveScrollPositionForEditor()
      @editor.off(".editor")

    @editor = editor
