From 1fd199085224627e340bf3353cd94263848e2d7c Mon Sep 17 00:00:00 2001 From: Sascha Lisson Date: Sat, 25 Nov 2023 17:07:32 +0100 Subject: [PATCH] write transaction was missing when attempting to create a new node --- .../src/commonMain/kotlin/org/modelix/editor/CellTemplate.kt | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/projectional-editor/src/commonMain/kotlin/org/modelix/editor/CellTemplate.kt b/projectional-editor/src/commonMain/kotlin/org/modelix/editor/CellTemplate.kt index bd3624cd..3010ad1d 100644 --- a/projectional-editor/src/commonMain/kotlin/org/modelix/editor/CellTemplate.kt +++ b/projectional-editor/src/commonMain/kotlin/org/modelix/editor/CellTemplate.kt @@ -173,7 +173,9 @@ class ConstantCellTemplate(concept: IConcept, val text: String) } override fun execute(editor: EditorComponent) { - val newNode = location.replaceNode(concept) + val newNode = location.getExistingAncestor()!!.getArea().executeWrite { + location.replaceNode(concept) + } editor.selectAfterUpdate { CaretPositionPolicy(newNode) .getBestSelection(editor)