       @hiddenInput.val(lastInput)
       false
 
+  bringHiddenInputIntoView: ->
+    @hiddenInput.css(top: @scrollTop() + 'px', left: 0)
+
   selectOnMousemoveUntilMouseup: ->
     lastMoveEvent = null
     moveHandler = (event = lastMoveEvent) =>

    @hiddenInput.on 'focusout', =>
      @isFocused = false
      @removeClass 'is-focused'
      @hiddenInput.offset(top: 0, left: 0)

    @underlayer.on 'mousedown', (e) =>
      @renderedLines.trigger(e)


  handleEvents: ->
    @on 'focus', =>
      @bringHiddenInputIntoView()
      @hiddenInput.focus()
      false

