Refresh Open Editor After Adding RangeHighlighter
I am adding and removing RangeHighlighters from MarkupModels. When I do this in response to a change made in the currently open file then the highlighter is correctly added or removed from the gutter of the open editor. But if add or remove highlighters from other open but not currently selected editors then the highlighter is not correctly displayed when the user switches to the that editor. As soon as the file in that editor is modified the highlighter is correctly displayed. How do I force IDEA to refresh the RangeHighlighters for a given editor or file?
Thanks,
Rod
Please sign in to leave a comment.
Hello Roderick,
What are you trying to achieve? Our API is designed with the assumption that
all highlighting happens only in a visible editor.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi Dmitry,
Thanks for your offer of help! I am trying to place a gutter annotation on particular lines in Java classes in response to asynchronous testing events. These classes may already be open in an editor, may be open but not visible, or may not be opened yet at all. As I mentioned the approach I am currently using is to add a RangeHighlight with a GutterIconRenderer to the appropriate MarkupModels. I am opened to other approaches as well, what would you recommend?
Thanks,
Rod
Hello Roderick,
You should store the lines to be annotated in your own model, and create
a highlighting pass or a LineMarkerProvider to place the information from
your model into the editor.
--
Dmitry Jemerov
Development Lead
JetBrains, Inc.
http://www.jetbrains.com/
"Develop with Pleasure!"
Hi Dmity,
Sounds promising, thanks! I'll give that a whirl in the next day or two and post back here how it worked out.
Thanks,
Rod
Hi Dmitry,
The HighlightingPass approach worked perfectly, thanks!
Rod