How to remove all document highlighter

Answered

I have add document highlighters as below,

markupModel.addLineHighlighter(line, HighlighterLayer.WARNING, attributes)

and I keep list of all document which i have added highlighters. when i want to remove highlighters,
loop the document list and remove highlighters.

is there a way to remove all highlighters without keep tracking documents manually and looping.
0
6 comments

You can remove highlighter directly without needing a reference to document, by executing

Disposer.dispose(highlighter)
0
Avatar
Permanently deleted user

i have added document highlighter,  how can i get highlighter to parse. 

0

You'll need to keep a reference to highlighter, returned by

addLineHighlighter
0
Avatar
Permanently deleted user

its return RangeHighlighter and that is not disposable

0

Sorry, my bad. It's not an instance of Disposable indeed. But it has 'dispose' method anyway - just call it directly.

0
Avatar
Permanently deleted user

Its works. Thank you.

0

Please sign in to leave a comment.