◐ Shell
reader mode source ↗
Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
File filter
Conversations
Jump to
Diff view
Apply and reload
Show whitespace
Diff view
Apply and reload
Original file line number Diff line number Diff line change
@@ -189,6 +189,8 @@ static void wrapInTag(
private final Function<String, String> lineNormalizer;
private final Function<String, String> processDiffs;
private final Function<InlineDeltaMergeInfo, List<AbstractDelta<String>>> inlineDeltaMerger;

private final boolean showInlineDiffs;
private final boolean replaceOriginalLinefeedInChangesWithSpaces;
Expand All @@ -214,6 +216,7 @@ private DiffRowGenerator(Builder builder) {
lineNormalizer = builder.lineNormalizer;
processDiffs = builder.processDiffs;
inlineDeltaMerger = builder.inlineDeltaMerger;

replaceOriginalLinefeedInChangesWithSpaces = builder.replaceOriginalLinefeedInChangesWithSpaces;

Expand Down Expand Up @@ -262,7 +265,8 @@ public List<DiffRow> generateDiffRows(final List<String> original, Patch<String>

// Copy the final matching chunk if any.
for (String line : original.subList(endPos, original.size())) {
diffRows.add(buildDiffRow(Tag.EQUAL, line, line));
}
return diffRows;
}
Expand All @@ -276,7 +280,8 @@ private int transformDeltaIntoDiffRow(
Chunk<String> rev = delta.getTarget();

for (String line : original.subList(endPos, orig.getPosition())) {
diffRows.add(buildDiffRow(Tag.EQUAL, line, line));
}

switch (delta.getType()) {
Expand Down @@ -496,6 +501,19 @@ private String preprocessLine(String line) {
}
}

/**
* This class used for building the DiffRowGenerator.
*
@@ -521,6 +539,8 @@ public static class Builder {
private boolean replaceOriginalLinefeedInChangesWithSpaces = false;
private Function<InlineDeltaMergeInfo, List<AbstractDelta<String>>> inlineDeltaMerger =
DEFAULT_INLINE_DELTA_MERGER;

private Builder() {}

Expand Down Expand Up @@ -613,6 +633,20 @@ public Builder processDiffs(Function<String, String> processDiffs) {
return this;
}

/**
* Set the column width of generated lines of original and revised
* texts.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
Toggle all file notes Toggle all file annotations