codeErrors = JsoArray.create();
}
@Override
public void renderNextChunk(Target target) {
CodeError nextError = getNextErrorToRender();
if (nextError == null) {
// No errors to render. So render the rest of the line with null.
renderNothingAndProceed(target, currentLineLength - linePosition);
} else if (nextError.getErrorStart().getLineNumber() < currentLineNumber ||
nextError.getErrorStart().getColumn() == linePosition) {
int errorLength;
if (nextError.getErrorEnd().getLineNumber() > currentLineNumber) {
errorLength = currentLineLength - linePosition;
} else {
// Error ends at current line.
errorLength = nextError.getErrorEnd().getColumn() + 1 - linePosition;
}
renderErrorAndProceed(target, errorLength);
} else {
// Wait until we get to the next error.
renderNothingAndProceed(target, nextError.getErrorStart().getColumn() - linePosition);
}
}