header.append(leftStart + 1); if (leftEnd - leftStart + 1 > 1) { header.append(","); header.append(leftEnd - leftStart + 1); }
if (leftStart == 0 && leftEnd < 0) { header.append("0,0"); } else { header.append(leftStart + 1); if (leftEnd - leftStart + 1 > 1) { header.append(","); header.append(leftEnd - leftStart + 1); } }
	protected void processBlock(QSequenceDifferenceBlock[] segment, QSequenceLineCache sourceLines, QSequenceLineCache targetLines,	                            String encoding, Writer output) throws IOException {		int gutter = getGutter();		// header		StringBuffer header = new StringBuffer();		header.append("@@");		int sourceStartLine = segment[0].getLeftFrom();		int sourceEndLine = segment[segment.length - 1].getLeftTo();		int targetStartLine = segment[0].getRightFrom();		int targetEndLine = segment[segment.length - 1].getRightTo();		int leftStart = Math.max(sourceStartLine - gutter, 0);		int rightStart = Math.max(targetStartLine - gutter, 0);		int leftEnd = Math.min(sourceEndLine + gutter, sourceLines.getLineCount() - 1);		int rightEnd = Math.min(targetEndLine + gutter, targetLines.getLineCount() - 1);		if (leftStart + 1 >= 0 && (leftEnd - leftStart + 1) >= 0) {			header.append(" -");			header.append(leftStart + 1);			if (leftEnd - leftStart + 1 > 1) {				header.append(",");				header.append(leftEnd - leftStart + 1);			}		}		if (rightStart + 1 > 0 && rightEnd - rightStart + 1 > 0) {			header.append(" +");			header.append(rightStart + 1);			if (rightEnd - rightStart + 1 > 1) {				header.append(",");				header.append(rightEnd - rightStart + 1);			}		}		header.append(" @@");		println(header.toString(), output);        		// print gutter context lines before blocks.		for (int i = leftStart; i < sourceStartLine; i++) {			print(" " + printLine(sourceLines.getLine(i), encoding), output);		}		for (int i = 0; i < segment.length; i++) {			QSequenceDifferenceBlock block = segment[i];			for (int j = block.getLeftFrom(); j <= block.getLeftTo(); j++) {				String line = printLine(sourceLines.getLine(j), encoding);				print("-" + line, output);				if (j == sourceLines.getLineCount() - 1 && isCompareEOLs()) {					printNoNewLine(output, line);				}			}			for (int j = block.getRightFrom(); j <= block.getRightTo(); j++) {				String line = printLine(targetLines.getLine(j), encoding);				print("+" + line, output);				if (j == targetLines.getLineCount() - 1 && isCompareEOLs()) {					printNoNewLine(output, line);				}			}			// print glue lines			int end = Math.min(block.getLeftTo() + gutter, sourceLines.getLineCount() - 1);			if (i + 1 < segment.length) {				end = Math.min(end, segment[i + 1].getLeftFrom() - 1);			}			for (int j = block.getLeftTo() + 1; j <= end; j++) {				String line = printLine(sourceLines.getLine(j), encoding);				print(" " + printLine(sourceLines.getLine(j), encoding), output);				if (j == sourceLines.getLineCount() - 1 && isCompareEOLs()) {					printNoNewLine(output, line);				}			}		}	}