Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1429,7 +1429,22 @@ public int diff_levenshtein(LinkedList<Diff> diffs) {
*/
public String diff_toDelta(LinkedList<Diff> diffs) {
StringBuilder text = new StringBuilder();
char lastEnd = 0;
boolean isFirst = true;
for (Diff aDiff : diffs) {
char thisTop = aDiff.text.charAt(0);
char thisEnd = aDiff.text.charAt(aDiff.text.length() - 1);
if (Character.isHighSurrogate(thisEnd)) {
aDiff.text = aDiff.text.substring(0, aDiff.text.length() - 1);
}
if (! isFirst && Character.isHighSurrogate(lastEnd) && Character.isLowSurrogate(thisTop)) {
aDiff.text = lastEnd + aDiff.text;
}
isFirst = false;
lastEnd = thisEnd;
if ( aDiff.text.isEmpty() ) {
continue;
}
switch (aDiff.operation) {
case INSERT:
try {
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ def gitDescribe() {
}

def static gitVersion() {
'0.9.1'
'0.9.2'
}