|Semantic highlighting [message #68186]
||Thu, 16 July 2009 01:37
Registered: July 2009
I'm trying to implement some semantic highlighting in my editor, by |
coloring certain words depending on their meaning in the document (just
like the Java editor will color class members a certain color).
Now, I have my parser generating the list of these words which I'm then
putting into a WordRule in my RuleBasedScanner. This works, except for the
fact that RuleBasedScanner only runs on the current line... so, I get
correct highlighting for the lines I'm editing, but the rest of the
document is sitting un-colored.
I'm not sure how to get the scanner to rescan the whole document? There is
a setRange method available, but calling setRange (doc, 0, doc.length())
does nothing. I'm guessing that whatever calls the scanner to do the
coloring is also re-setting this range to the current line. I'm not sure
where this call occurs, though, and I'd like to override it to re-scan the
whole document every once in a while...
Any suggestions would be much appreciated!
Powered by FUDForum
. Page generated in 0.02469 seconds