If you attempt to use selectRange to update caret and anchor positions that have attached listeners, the caret and anchor potitions will be stale.
@Test fun `sscce`(){
val underTest = StyleClassedTextArea()
//comment out this line of code and the test passes
val dontCare = Bindings.createStringBinding(Callable { "binded" }, underTest.caretPositionProperty(), underTest.anchorProperty())
underTest.appendText("asdf")
//act
underTest.selectRange(1, 2)
//assert
assertThat(underTest.selectedText).isEqualTo("s") //OK
assertThat(listOf(underTest.anchor, underTest.caretPosition)).isEqualTo(listOf(1, 2)) //fail
//actual: 0, 2
}
If you attempt to use
selectRangeto update caret and anchor positions that have attached listeners, the caret and anchor potitions will be stale.