Improved Mark Occurrences Behavior

Commit 97 in SVN improved Mark Occurrences support behavior in RSyntaxTextArea. Previously, there were two issues with it that were kind of annoying:

  1. The Mark Occurrences highlights were always painted “on top of” the selection. This was because of how Swing highlighting support is implemented – highlights are always painted from most-recently added to least-recently added. Since text selection is actually a highlight, if you selected text after say some occurrences of a variable were marked in the document, the variable occurrences’ highlights get painted on top of the selection’s highlight.
  2. When typing characters at the end of a Mark Occurrences highlight, those chars got “absorbed” into the highlight. Again, this is because of Swing’s highlight implementation. All Highlights have this behavior in Swing.

These issues are fairly simple to work around, but require writing a little more code (much of which unfortunately has to be duplicated from Swing classes, since the Swing text package is keen on keeping useful things package private).

This change will be in 1.3.3, which will hopefully be released soon.

Comments are closed.