Sample font styling when font config values change

We previously could do it whenever stylesheets changed, but these values
end up getting assigned to the global stylesheet for cascading reasons
and we’re only watching the local stylesheet. We poll the host elements
DOM properties, but forcing a sync poll when the config values change
makes behavior synchronous for specs and more responsive when changing
these values.
This commit is contained in:
Nathan Sobo
2014-10-16 13:55:52 -06:00
parent 58744f6b7b
commit 1f777addd9

View File

@@ -416,6 +416,9 @@ TextEditorComponent = React.createClass
observeConfig: ->
@subscribe atom.config.observe 'editor.useHardwareAcceleration', @setUseHardwareAcceleration
@subscribe atom.config.onDidChange 'editor.fontSize', @sampleFontStyling
@subscribe atom.config.onDidChange 'editor.fontFamily', @sampleFontStyling
@subscribe atom.config.onDidChange 'editor.lineHeight', @sampleFontStyling
onGrammarChanged: ->
{editor} = @props