int lastStart = region.getOffset();
int length = 0;
boolean firstToken = true;
IToken lastToken = Token.UNDEFINED;
TextAttribute lastAttribute = getTokenTextAttribute(lastToken);
fScanner.setRange(fDocument, lastStart, region.getLength());
while (true) {
final IToken token = fScanner.nextToken();
if (token == null) {
try {
ErlLogger.warn("null token from '%s'>>>",
fDocument.get(lastStart, region.getLength()));
} catch (final BadLocationException e) {
ErlLogger.warn("null token from '%s'", fDocument.get());
}
break;
}
if (token.isEOF()) {
break;
}
final TextAttribute attribute = getTokenTextAttribute(token);
// if (lastAttribute != null && lastAttribute.equals(attribute)) {
// length += fScanner.getTokenLength();
// firstToken= false;
// } else {
if (!firstToken) {