void (@NotNull LineFragment fragment, int fragmentIndex) { int startLine1 = fragment.getStartLine1(); int endLine1 = fragment.getEndLine1() - 1; int lines1 = endLine1 - startLine1; int startLine2 = fragment.getStartLine2(); int endLine2 = fragment.getEndLine2() - 1; int lines2 = endLine2 - startLine2; int linesBefore = totalLines; int linesAfter; if (lines1 >= 0) { int startOffset1 = myDocument1.getLineStartOffset(startLine1); int endOffset1 = myDocument1.getLineEndOffset(endLine1); appendText(Side.LEFT, startOffset1, endOffset1, lines1, lines2, startLine1, -1); } int linesBetween = totalLines; if (lines2 >= 0) { int startOffset2 = myDocument2.getLineStartOffset(startLine2); int endOffset2 = myDocument2.getLineEndOffset(endLine2); appendText(Side.RIGHT, startOffset2, endOffset2, lines2, lines2, -1, startLine2); } linesAfter = totalLines; UnifiedDiffChange change = createDiffChange(linesBefore, linesBetween, linesAfter, fragmentIndex); myChanges.add(change); if (!change.isSkipped()) { myChangedLines.add(new LineRange(linesBefore, linesAfter)); } lastProcessedLine1 = endLine1; lastProcessedLine2 = endLine2; }