Add DisplayBufferMarker::onDidChange and ::onDidDestroy

This commit is contained in:
Nathan Sobo
2014-09-04 12:07:40 -06:00
committed by Ben Ogle
parent 651eb78315
commit 1131b33a83
4 changed files with 23 additions and 10 deletions

View File

@@ -44,7 +44,7 @@ class Cursor extends Model
constructor: ({@editor, @marker, id}) ->
@assignId(id)
@updateVisibility()
@marker.on 'changed', (e) =>
@marker.onDidChange (e) =>
@updateVisibility()
{oldHeadScreenPosition, newHeadScreenPosition} = e
{oldHeadBufferPosition, newHeadBufferPosition} = e
@@ -66,7 +66,7 @@ class Cursor extends Model
@emit 'moved', movedEvent
@editor.cursorMoved(this, movedEvent)
@marker.on 'destroyed', =>
@marker.onDidDestroy =>
@destroyed = true
@editor.removeCursor(this)
@emit 'destroyed'