From: Makarius <mak...@sk...> - 2010-09-06 09:46:51
|
On Sat, 4 Sep 2010, Shlomy Reinstein wrote: > If your model consists of single-line tokens only, it might be > worthwhile adding an attribute to the token marker system to specify > that it doesn't need context but can infer the tokens of each line > independently. Would that solve your problem? Yes, that is indeed the case. My background model of the buffer's content already holds all the information. If jEdit gives me the line start offset in the markToken invocation then I can reproduce the line's tokens on the spot, independent of other lines. I am doing it in that way in my TextAreaExtension.paintScreenLineRange (with the extra aspect that a whole bunch of lines can be treated here, but this is not essential). In principle, my model holds all the markup for some notion of "styled text document", and parts of it are rendered as decoration below or above the text (TextAreaExtension) and other parts of it are turned into text styles (TokenMarker.markTokens). Makarius |