mirror of
https://github.com/atom/atom.git
synced 2026-01-25 06:48:28 -05:00
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:
committed by
Antonio Scandurra
parent
62c1bad39c
commit
9e3999cab9
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user