diff --git a/spec/editor-component-spec.coffee b/spec/editor-component-spec.coffee index def910f35..29ae73fdf 100644 --- a/spec/editor-component-spec.coffee +++ b/spec/editor-component-spec.coffee @@ -384,6 +384,12 @@ describe "EditorComponent", -> expect(cursorNodes.length).toBe 1 expect(cursorNodes[0].style['-webkit-transform']).toBe "translate3d(#{8 * charWidth}px, #{6 * lineHeightInPixels}px, 0px)" + it "updates cursor positions when the line height changes", -> + editor.setCursorBufferPosition([1, 10]) + cursorNode = node.querySelector('.cursor') + component.setLineHeight(2) + expect(cursorNode.style['-webkit-transform']).toBe "translate3d(#{10 * editor.getDefaultCharWidth()}px, #{editor.getLineHeightInPixels()}px, 0px)" + describe "selection rendering", -> [scrollViewNode, scrollViewClientLeft] = [] diff --git a/src/cursors-component.coffee b/src/cursors-component.coffee index 8f81bc647..e762adef3 100644 --- a/src/cursors-component.coffee +++ b/src/cursors-component.coffee @@ -33,8 +33,8 @@ CursorsComponent = React.createClass @stopBlinkingCursors() shouldComponentUpdate: (newProps, newState) -> - not isEqualForProperties(newProps, @props, 'cursorScreenRanges', 'scrollTop', 'scrollLeft') or - not newState.blinkOff is @state.blinkOff + not newState.blinkOff is @state.blinkOff or + not isEqualForProperties(newProps, @props, 'cursorScreenRanges', 'scrollTop', 'scrollLeft', 'lineHeightInPixels') componentWillUpdate: (newProps) -> @pauseCursorBlinking() if @props.cursorScreenRanges and not isEqual(newProps.cursorScreenRanges, @props.cursorScreenRanges)