diff --git a/src/cursors-component.coffee b/src/cursors-component.coffee index 057c42d69..57d32b616 100644 --- a/src/cursors-component.coffee +++ b/src/cursors-component.coffee @@ -12,15 +12,15 @@ CursorsComponent = React.createClass cursorBlinkIntervalHandle: null render: -> - {performedInitialMeasurement, cursorPixelRects, defaultCharWidth} = @props + {presenter, defaultCharWidth} = @props {blinkOff} = @state className = 'cursors' className += ' blink-off' if blinkOff div {className}, - if performedInitialMeasurement - for key, pixelRect of cursorPixelRects + if presenter? + for key, pixelRect of presenter.state.content.cursors CursorComponent({key, pixelRect, defaultCharWidth}) getInitialState: -> @@ -32,10 +32,6 @@ CursorsComponent = React.createClass componentWillUnmount: -> @stopBlinkingCursors() - shouldComponentUpdate: (newProps, newState) -> - not newState.blinkOff is @state.blinkOff or - not isEqualForProperties(newProps, @props, 'cursorPixelRects', 'scrollTop', 'scrollLeft', 'defaultCharWidth', 'useHardwareAcceleration') - componentWillUpdate: (newProps) -> cursorsMoved = @props.cursorPixelRects? and isEqualForProperties(newProps, @props, 'defaultCharWidth', 'scopedCharacterWidthsChangeCount') and diff --git a/src/lines-component.coffee b/src/lines-component.coffee index 969419f9e..341aeab30 100644 --- a/src/lines-component.coffee +++ b/src/lines-component.coffee @@ -17,7 +17,7 @@ LinesComponent = React.createClass displayName: 'LinesComponent' render: -> - {performedInitialMeasurement, cursorBlinkPeriod, cursorBlinkResumeDelay} = @props + {presenter, performedInitialMeasurement, cursorBlinkPeriod, cursorBlinkResumeDelay} = @props if performedInitialMeasurement {editor, presenter, overlayDecorations, highlightDecorations, placeholderText, backgroundColor} = @props @@ -37,8 +37,7 @@ LinesComponent = React.createClass div className: 'placeholder-text', placeholderText if placeholderText? CursorsComponent { - cursorPixelRects, cursorBlinkPeriod, cursorBlinkResumeDelay, lineHeightInPixels, - defaultCharWidth, scopedCharacterWidthsChangeCount, performedInitialMeasurement + presenter, cursorBlinkPeriod, cursorBlinkResumeDelay, defaultCharWidth } HighlightsComponent {