RSyntaxTextArea
RSyntaxTextArea copied to clipboard
No marking if cursor is at end of file
Description
There is a bug when using SearchEngine.find(...) . The problem is, that getFindInText() is called before the marking and if there is no text after the cursot (Caret), a new SearchResult() is returned.
Steps to Reproduce Specific steps to reproduce the behavior:
- Set the cursor at the end of a JTextArea
- call the
findmethod using a valid SearchContext (e.g. search for "e" in a text that contains some "e") - Now a empty new SearchResult is returned and no "e" got marked in the text.
- If you set the cursor one back (second last position), everything works as expected
Expected behavior All matching results should be marked regardless of the current cursor position. Even if wrap around is disabled
Actual behavior No marking if cursor at last position.
Screenshots Add a screenshot if it helps explain the problem.
Java version jdk-17.0.6.10
Additional context
Just call markAllImpl() before getFindInText().
I will create a pullrequest with a fix.