Only pause cursor blink when cursors actually move

Not when they are just repositioned due to lineHeight/charWidth changes
This commit is contained in:
Nathan Sobo
2014-06-24 13:26:21 -06:00
parent 74dbfbc956
commit b127155805

View File

@@ -37,7 +37,11 @@ CursorsComponent = React.createClass
not isEqualForProperties(newProps, @props, 'cursorPixelRects', 'scrollTop', 'scrollLeft', 'defaultCharWidth')
componentWillUpdate: (newProps) ->
@pauseCursorBlinking() if @props.cursorPixelRects? and not isEqual(newProps.cursorPixelRects, @props.cursorPixelRects)
cursorsMoved = @props.cursorPixelRects? and
isEqualForProperties(newProps, @props, 'defaultCharWidth', 'scopedCharacterWidthsChangeCount') and
not isEqual(newProps.cursorPixelRects, @props.cursorPixelRects)
@pauseCursorBlinking() if cursorsMoved
startBlinkingCursors: ->
@toggleCursorBlinkHandle = setInterval(@toggleCursorBlink, @props.cursorBlinkPeriod / 2) if @isMounted()