Emit 'cursor:moved' event to update cursor position in status bar

Emitting the event *before* update, rather than after. This is because
we read from the DOM after update to measure new characters, which
forces layout, so emitting the event after measuring forces another
layout when the position is updated.
This commit is contained in:
Nathan Sobo
2014-04-17 16:03:26 -06:00
parent e5379515b9
commit bef554709f

View File

@@ -75,6 +75,9 @@ EditorComponent = React.createClass
componentWillUnmount: ->
@getDOMNode().removeEventListener 'mousewheel', @onMouseWheel
componentWillUpdate: ->
@props.parentView.trigger 'cursor:moved' if @cursorsMoved
componentDidUpdate: ->
@pendingChanges.length = 0
@cursorsMoved = false