diff --git a/richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/selection/PositionTests.java b/richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/selection/PositionTests.java index c8b404b07..d250917b2 100644 --- a/richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/selection/PositionTests.java +++ b/richtextfx/src/integrationTest/java/org/fxmisc/richtext/api/selection/PositionTests.java @@ -159,7 +159,6 @@ public void end_position_is_correct_when_change_occurs_after_position() { }); } - @Test public void deletion_which_includes_selection_and_which_occurs_at_end_of_area_moves_selection_to_new_area_end() { interact(() -> { selection.selectRange(area.getLength(), area.getLength()); @@ -168,16 +167,4 @@ public void deletion_which_includes_selection_and_which_occurs_at_end_of_area_mo assertEquals(area.getLength(), selection.getEndPosition()); }); } - - @Test - public void anchor_updates_correctly_with_listener_attached() { - interact(() -> { - area.clear(); - area.anchorProperty().addListener( (ob,ov,nv) -> nv++ ); - area.appendText("asdf"); - area.selectRange(1,2); - assertEquals("s",area.getSelectedText()); - assertEquals(1,area.getAnchor()); - }); - } } diff --git a/richtextfx/src/main/java/org/fxmisc/richtext/CaretSelectionBindImpl.java b/richtextfx/src/main/java/org/fxmisc/richtext/CaretSelectionBindImpl.java index a2290b096..525e5ec65 100644 --- a/richtextfx/src/main/java/org/fxmisc/richtext/CaretSelectionBindImpl.java +++ b/richtextfx/src/main/java/org/fxmisc/richtext/CaretSelectionBindImpl.java @@ -431,10 +431,6 @@ public void displaceCaret(int position) { public void displaceSelection(int startPosition, int endPosition) { doUpdate(() -> { delegateSelection.selectRange(startPosition, endPosition); - - if ( startPosition < endPosition && internalStartedByAnchor.getValue() ) { - internalStartedByAnchor.setValue( false ); // See #874 - } internalStartedByAnchor.setValue(startPosition < endPosition); }); } @@ -453,10 +449,6 @@ public void dispose() { private void doSelect(int startPosition, int endPosition, boolean anchorIsStart) { doUpdate(() -> { delegateSelection.selectRange(startPosition, endPosition); - - if ( anchorIsStart && internalStartedByAnchor.getValue() ) { - internalStartedByAnchor.setValue( false ); // See #874 - } internalStartedByAnchor.setValue(anchorIsStart); delegateCaret.moveTo(anchorIsStart ? endPosition : startPosition);