diff --git a/richtextfx/src/main/java/org/fxmisc/richtext/EditActions.java b/richtextfx/src/main/java/org/fxmisc/richtext/EditActions.java index 856236d45..aef511535 100644 --- a/richtextfx/src/main/java/org/fxmisc/richtext/EditActions.java +++ b/richtextfx/src/main/java/org/fxmisc/richtext/EditActions.java @@ -190,8 +190,11 @@ default void moveSelectedText(int position) { StyledDocument text = this.subDocument(sel.getStart(), sel.getEnd()); if(position > sel.getEnd()) position -= sel.getLength(); - deleteText(sel); - insert(position, text); + + createMultiChange(2) + .deleteText(sel) + .insertAbsolutely(position, text) + .commit(); // select moved text selectRange(position, position + text.length());