bobbylight / RSyntaxTextArea

A syntax highlighting, code folding text editor for Java Swing applications.
BSD 3-Clause "New" or "Revised" License
1.12k stars 259 forks source link

Fix #581: Overzealous Mark Occurrences for single characters #582

Closed bobbylight closed 5 days ago

bobbylight commented 5 days ago

Discussed as part of the issue in #575. The "Mark Occurrences" support usually highlights all instances of any token of type "identifier." Unfortunately many TokenMaker implementations style the characters ,, ;, and . (and possibly others) as identifiers for aesthetic purposes only. This has the side effect of the Mark Occurrences support highlighting all instances of them if the caret pauses near them.

At bets, this is visually surprising. At worst, it can cause the editor to hang for very large files with many instances of the character at the caret.

We should skip marking occurrences of non-word characters at any location. In 4.0.0 we can look at a more robust solution.

codecov[bot] commented 5 days ago

Codecov Report

Attention: Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Project coverage is 80.35%. Comparing base (294a830) to head (ef03839). Report is 1 commits behind head on master.

Files with missing lines Patch % Lines
...fe/ui/rsyntaxtextarea/DefaultOccurrenceMarker.java 66.66% 0 Missing and 1 partial :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #582 +/- ## ============================================ - Coverage 80.36% 80.35% -0.01% - Complexity 7778 7781 +3 ============================================ Files 178 178 Lines 30232 30235 +3 Branches 3909 3910 +1 ============================================ Hits 24295 24295 - Misses 4262 4267 +5 + Partials 1675 1673 -2 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.


🚨 Try these New Features: