while (pos < p1) {
if (lastCtx != ctx) {
//syntax = context.getSyntaxName(lastCtx);
g.setColor(context.getSyntaxForeground(lastCtx));
g.setFont(context.getSyntaxFont(lastCtx));
Segment text = getLineBuffer();
doc.getText(mark, pos - mark, text);
x = Utilities.drawTabbedText(text, x, y, g, this, mark);
mark = pos;
}
pos = lexer.scan(ctx) + token.getStartOffset();
lastCtx = ctx;
ctx = lexer.getScanValue();
}
// flush remaining
//syntax = context.getSyntaxName(lastCtx);
g.setColor(context.getSyntaxForeground(lastCtx));
g.setFont(context.getSyntaxFont(lastCtx));
Segment text = getLineBuffer();
doc.getText(mark, p1 - mark, text);
x = Utilities.drawTabbedText(text, x, y, g, this, mark);
return x;
}