bobbylight / RSyntaxTextArea

A syntax highlighting, code folding text editor for Java Swing applications.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Select Word using double click do not work second time if mouse is not moved

ovna01 opened this issue · comments

commented

Description
Select Word using double click do not work second time if mouse is not moved.

Steps to Reproduce
Open RSyntaxTextAreaDemoApp

  1. Enter a word e.g. "help"
  2. Double click on the word to select it
  3. Single click to remove selection without moving the mouse
  4. 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.