Make TokenizedBuffer a telepath.Model subclass

There's a bunch of improvised code to make this work right now because
of the circularity of this refactoring. It will stabilize over time.
This commit is contained in:
Nathan Sobo
2013-12-07 02:25:47 -08:00
parent b61654b52f
commit a4d2b4d21a
9 changed files with 75 additions and 82 deletions

View File

@@ -81,12 +81,12 @@ class TextBuffer extends telepath.Model
@emit 'changed', bufferChangeEvent
@scheduleModifiedEvents()
destroy: ->
unless @destroyed
destroyed: ->
unless @alreadyDestroyed
@cancelStoppedChangingTimeout()
@file?.off()
@unsubscribe()
@destroyed = true
@alreadyDestroyed = true
@emit 'destroyed', this
isRetained: -> @refcount > 0