DiffRenderer beforeRenderer = new DiffRenderer(beforeDoc, appContext.getResources(), true);
DiffRenderer afterRenderer = new DiffRenderer(afterDoc, appContext.getResources(), false);
for (int i = 0, n = diffChunks.size(); i < n; i++) {
DiffChunkResponse diffChunk = diffChunks.get(i);
String beforeText = diffChunk.getBeforeData();
String afterText = diffChunk.getAfterData();
beforeRenderer.addDiffChunk(diffChunk.getDiffType(), beforeText);
afterRenderer.addDiffChunk(diffChunk.getDiffType(), afterText);
}
// TODO: This setup is a bit awkward so that we can defer setting
// the editor's document in order to workaround some editor bugs. Clean this
// up once those bugs are resolved.