I have a plugin that searches for text in the Editor. I am using MarkupModel.addRangeHighlighter(...) with a CustomHighlightRenderer to paint highlights in the Editor. The advantage of using a CustomHighlightRenderer is that all highlights are uniformly "bound" to the editor text, so scrolling is smooth and seamless (and all locations can be painted at once). However there are some components that need to be painted over the editor text, which I am doing via Graphics2D separately, by laying a new component on top of the Editor's contentComponent. I would like to use a CustomHighlightRenderer for these components as well (since they are visually attached to highlights), but unfortunately they need to be painted over, rather than under the Editor text.
Is it possible to paint over the editor text, covering the entire region like RangeHighlighter, so that scrolling is smooth and seamless? I would like to avoid listening for scrolling updates and repainting, which is slow and glitchy. Thanks!