From 9e3999cab9de99688d8dcbce432ccdb7595238cf Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Thu, 2 Mar 2017 10:04:07 -0700 Subject: [PATCH] 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. --- src/text-editor.coffee | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/text-editor.coffee b/src/text-editor.coffee index 3cdd363a7..1f24fa252 100644 --- a/src/text-editor.coffee +++ b/src/text-editor.coffee @@ -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