Skip to content

Commit

Permalink
Revert "Added test and anchor properties fix (#875)"
Browse files Browse the repository at this point in the history
This reverts commit d0efe97.
  • Loading branch information
Jugen authored Nov 26, 2019
1 parent d0efe97 commit 4a1ccb9
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand All @@ -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());
});
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
}
Expand All @@ -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);
Expand Down

0 comments on commit 4a1ccb9

Please sign in to comment.