mirror of
https://github.com/atom/atom.git
synced 2026-01-23 05:48:10 -05:00
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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user