Move event listener calls from resetDisplay to edit

Fixes #140
This commit is contained in:
Corey Johnson & Nathan Sobo
2013-04-24 11:29:46 -07:00
parent 2a6c4b04b1
commit 24ce415283
2 changed files with 20 additions and 8 deletions

View File

@@ -826,6 +826,14 @@ class Editor extends View
@activeEditSession.on "grammar-changed.editor", =>
@trigger 'editor:grammar-changed'
@activeEditSession.on 'selection-added.editor', (selection) =>
@newCursors.push(selection.cursor)
@newSelections.push(selection)
@requestDisplayUpdate()
@activeEditSession.on 'screen-lines-changed.editor', (e) =>
@handleScreenLinesChange(e)
@trigger 'editor:path-changed'
@resetDisplay()
@@ -1178,14 +1186,6 @@ class Editor extends View
@removeAllCursorAndSelectionViews()
@updateLayerDimensions()
@setScrollPositionFromActiveEditSession()
@activeEditSession.on 'selection-added.editor', (selection) =>
@newCursors.push(selection.cursor)
@newSelections.push(selection)
@requestDisplayUpdate()
@activeEditSession.on 'screen-lines-changed.editor', (e) => @handleScreenLinesChange(e)
@newCursors = @activeEditSession.getCursors()
@newSelections = @activeEditSession.getSelections()
@updateDisplay(suppressAutoScroll: true)