Guard against a null pending changed event

Previously TextBuffer would emit change events even when the change
was empty. SharedString does not emit empty change events and so a
pending event may no longer be present when a marker-updated event
fires.
This commit is contained in:
Kevin Sawicki & Nathan Sobo
2013-07-02 15:32:44 -07:00
committed by Kevin Sawicki
parent 2ff282011b
commit e01ac96b66

View File

@@ -605,9 +605,9 @@ class DisplayBuffer
@maxLineLength = length
handleMarkersUpdated: =>
event = @pendingChangeEvent
@pendingChangeEvent = null
@triggerChanged(event, false)
if event = @pendingChangeEvent
@pendingChangeEvent = null
@triggerChanged(event, false)
handleMarkerCreated: (marker) =>
new Fold(this, marker) if marker.matchesAttributes(@foldMarkerAttributes())