diff --git a/src/text-editor-component.coffee b/src/text-editor-component.coffee index 9a9c46117..72efb1a9b 100644 --- a/src/text-editor-component.coffee +++ b/src/text-editor-component.coffee @@ -23,8 +23,6 @@ TextEditorComponent = React.createClass visible: false autoHeight: false - backgroundColor: null - gutterBackgroundColor: null pendingScrollTop: null pendingScrollLeft: null selectOnMouseMove: false @@ -98,7 +96,7 @@ TextEditorComponent = React.createClass LinesComponent { ref: 'lines', @presenter, editor, hostElement, @useHardwareAcceleration, useShadowDOM, - mouseWheelScreenRow, visible, @backgroundColor + mouseWheelScreenRow, visible } ScrollbarComponent @@ -773,16 +771,11 @@ TextEditorComponent = React.createClass {hostElement} = @props {backgroundColor} = getComputedStyle(hostElement) - if backgroundColor isnt @backgroundColor - @backgroundColor = backgroundColor - @presenter.setBackgroundColor(backgroundColor) + @presenter.setBackgroundColor(backgroundColor) if @refs.gutter? gutterBackgroundColor = getComputedStyle(@refs.gutter.getDOMNode()).backgroundColor - if gutterBackgroundColor isnt @gutterBackgroundColor - @gutterBackgroundColor = gutterBackgroundColor - @presenter.setGutterBackgroundColor(gutterBackgroundColor) - @requestUpdate() unless suppressUpdate + @presenter.setGutterBackgroundColor(gutterBackgroundColor) measureLineHeightAndDefaultCharWidth: -> if @isVisible() diff --git a/src/text-editor-presenter.coffee b/src/text-editor-presenter.coffee index 01bc6fced..b250cc6bd 100644 --- a/src/text-editor-presenter.coffee +++ b/src/text-editor-presenter.coffee @@ -389,13 +389,17 @@ class TextEditorPresenter getClientWidth: -> @clientWidth - setBackgroundColor: (@backgroundColor) -> - @updateContentState() + setBackgroundColor: (backgroundColor) -> + if backgroundColor isnt @backgroundColor + @backgroundColor = backgroundColor + @updateContentState() getBackgroundColor: -> @backgroundColor - setGutterBackgroundColor: (@gutterBackgroundColor) -> - @updateGutterState() + setGutterBackgroundColor: (gutterBackgroundColor) -> + if gutterBackgroundColor isnt @gutterBackgroundColor + @gutterBackgroundColor = gutterBackgroundColor + @updateGutterState() getGutterBackgroundColor: -> @gutterBackgroundColor