Select Word using double click do not work second time if mouse is not moved
ovna01 opened this issue · comments
Description
Select Word using double click do not work second time if mouse is not moved.
Steps to Reproduce
Open RSyntaxTextAreaDemoApp
- Enter a word e.g. "help"
- Double click on the word to select it
- Single click to remove selection without moving the mouse
- Double click on the word again without moving the mouse to select it -> now the word is not selected
Expected behavior
The second double click should select the word again
Actual behavior
The second double click does not select the word again
Java version
Java 17.0.4.1 Eclipse Adoptium
Additional context
The problem is probably due to that the class ConfigurableCaret overrides the method mouseClicked(MouseEvent e) and do not set the selectedWordEvent=null as in the overridden method in DefaultCaret.
The selectedWordEvent is used in the DefaultCaret method selectWord(MouseEvent e) to check if the mouse position has changed.