Skip to content

Commit 04b9ada

Browse files
Aleksandr BeschasnyiJugen
authored andcommitted
Fixes #774 (#775)
* Fix replace selected text with longer pasted text bug #774
1 parent 17a7957 commit 04b9ada

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

richtextfx/src/main/java/org/fxmisc/richtext/SelectionImpl.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,9 @@ public SelectionImpl(String name, GenericStyledArea<PS, SEG, S> area, int startP
260260
? indexOfChange
261261
: finalEnd + netLength;
262262
}
263+
if (finalStart > finalEnd) {
264+
finalStart = finalEnd;
265+
}
263266
} else {
264267
// force-update internalSelection in case empty selection is
265268
// at the end of area and a character was deleted

0 commit comments

Comments
 (0)