Skip to content

Commit

Permalink
write transaction was missing when attempting to create a new node
Browse files Browse the repository at this point in the history
  • Loading branch information
slisson committed Nov 25, 2023
1 parent b46c8e9 commit 1fd1990
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1fd1990

Please sign in to comment.