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)