Fixed crash

This commit is contained in:
SuspiciousActivity authored and GitHub committed 2020-11-26 17:07:36 +01:00
1 parent 65235c6b5b
commit 30c9c81d38
1 file changed
+10
@@ -403,6 +403,9 @@ public class TokenImpl implements Token {
int last = getOffset();
FontMetrics fm = null;
while (token != null && token.isPaintable()) {
if (token.textCount > 10000) {
return getOffset() + (int) (x / 7);
}
fm = textArea.getFontMetricsForTokenType(token.getType());
char[] text = token.text;
int start = token.textOffset;
@@ -786,6 +789,13 @@ public class TokenImpl implements Token {
this.type = type;
}
public void reset() {
text = null;
offset = -1;
type = Token.NULL;
nextToken = null;
}
/**
* {@inheritDoc}
*/