Cause an assertion failure if defaultMarkerLayer is destroyed early

This is to investigate a case where the default marker layer of the
editor is destroyed without the editor itself or its buffer being
destroyed, which is causing `Cannot decorate a destroyed marker`
exceptions.
This commit is contained in:
Nathan Sobo
2017-03-02 10:04:07 -07:00
committed by Antonio Scandurra
parent 62c1bad39c
commit 9e3999cab9

View File

@@ -192,6 +192,9 @@ class TextEditor extends Model
@displayLayer.setTextDecorationLayer(@tokenizedBuffer)
@defaultMarkerLayer = @displayLayer.addMarkerLayer()
@disposables.add(@defaultMarkerLayer.onDidDestroy =>
@assert(false, "defaultMarkerLayer destroyed at an unexpected time")
)
@selectionsMarkerLayer ?= @addMarkerLayer(maintainHistory: true, persistent: true)
@selectionsMarkerLayer.trackDestructionInOnDidCreateMarkerCallbacks = true