mirror of
https://github.com/atom/atom.git
synced 2026-01-24 14:28:14 -05:00
Observe scroll* behaviors instead of the entire state document
This commit is contained in:
@@ -89,13 +89,9 @@ class Editor extends Model
|
||||
@addCursorAtBufferPosition(position)
|
||||
|
||||
@languageMode = new LanguageMode(this, @buffer.getExtension())
|
||||
@subscribe @state, 'changed', ({newValues}) =>
|
||||
for key, newValue of newValues
|
||||
switch key
|
||||
when 'scrollTop'
|
||||
@emit 'scroll-top-changed', newValue
|
||||
when 'scrollLeft'
|
||||
@emit 'scroll-left-changed', newValue
|
||||
|
||||
@subscribe @$scrollTop, 'value', (scrollTop) => @emit 'scroll-top-changed', scrollTop
|
||||
@subscribe @$scrollLeft, 'value', (scrollLeft) => @emit 'scroll-left-changed', scrollLeft
|
||||
|
||||
# Deprecated: The goal is a world where we don't call serialize explicitly
|
||||
serialize: -> this
|
||||
|
||||
Reference in New Issue
Block a user