Don't update the DisplayBuffer when a fold's marker changes

Because we don't currently allow for direct manipulation of fold
marker ranges, if a fold's marker changes it will be because of a
buffer change. This buffer change will bubble to the display buffer
anyway, where the screen line update will account for the change to
the fold's marker range.
This commit is contained in:
Nathan Sobo
2013-04-30 15:07:37 -06:00
parent 2e77f0ed7d
commit 40512a4823

View File

@@ -14,10 +14,6 @@ class Fold
constructor: (@displayBuffer, @marker) ->
@displayBuffer.foldsByMarkerId[@marker.id] = this
@updateDisplayBuffer()
@marker.on 'changed', (e) =>
oldRange = new Range(e.oldHeadBufferPosition, e.oldTailBufferPosition)
newRange = new Range(e.newHeadBufferPosition, e.newTailBufferPosition)
@updateDisplayBuffer() unless newRange.isEqual(oldRange)
@marker.on 'destroyed', => @destroyed()
# Returns whether this fold is contained within another fold