Break out state updates explicitly when editor content changes

This commit is contained in:
Nathan Sobo
2015-01-29 15:13:27 -07:00
parent f005b2005f
commit 9d507ea692

View File

@@ -30,7 +30,14 @@ class TextEditorPresenter
@emitter.on 'did-update-state', callback
observeModel: ->
@disposables.add @model.onDidChange(@updateState.bind(this))
@disposables.add @model.onDidChange =>
@updateHeightState()
@updateVerticalScrollState()
@updateHorizontalScrollState()
@updateContentState()
@updateLinesState()
@updateGutterState()
@updateLineNumbersState()
@disposables.add @model.onDidChangeSoftWrapped(@updateState.bind(this))
@disposables.add @model.onDidChangeGrammar(@updateContentState.bind(this))
@disposables.add @model.onDidChangePlaceholderText(@updateContentState.bind(this))