As analysed in the bug, the previousWord() method does not work correctly if at 
the word boundary a character is found that is neither letter nor digit.
This fix changes the method so that only ranges of whitespace will be skipped, 
resulting in correct word selection behaviour.
A test case has been added to TextAreaTest.
gradlew :controls:test --tests test.javafx.scene.control.Text*Test has been 
executed to ensure no regressions happen in other text related classes. No 
errors were reported.


---------
- [X] I confirm that I make this contribution in accordance with the [OpenJDK 
Interim AI Policy](https://openjdk.org/legal/ai).

-------------

Commit messages:
 - 8264588: Fix previousWord for correct word selection.

Changes: https://git.openjdk.org/jfx/pull/2334/files
  Webrev: https://webrevs.openjdk.org/?repo=jfx&pr=2334&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8264588
  Stats: 19 lines in 2 files changed: 17 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jfx/pull/2334.diff
  Fetch: git fetch https://git.openjdk.org/jfx.git pull/2334/head:pull/2334

PR: https://git.openjdk.org/jfx/pull/2334

Reply via email to