           expect(editor.getSelectedScreenRange()).toEqual [[2, 4], [6, 8]]
 
           editor.insertText('x')
-
-        waitsForAnimationFrame()
+          waitsForAnimationFrame()
 
         runs ->
           expect(editor.getSelectedScreenRange()).toEqual [[2, 5], [2, 5]]

          wheelEvent = new WheelEvent('mousewheel', wheelDeltaX: 0, wheelDeltaY: -500)
          Object.defineProperty(wheelEvent, 'target', get: -> lineNumberNode)
          componentNode.dispatchEvent(wheelEvent)

        waitsForAnimationFrame()

        runs ->
          expect(componentNode.contains(lineNumberNode)).toBe true

          maximalScrollTop = wrapperNode.getScrollTop()

          linesNode.dispatchEvent(buildMouseEvent('mousemove', clientCoordinatesForScreenPosition([8, 4]), which: 1))
          waitsForAnimationFrame()

        runs ->
          expect(editor.getSelectedScreenRange()).toEqual [[5, 0], [8, 0]]
