Modify styles of split diff.

This commit is contained in:
Shintaro Murakami
2014-09-23 00:07:00 +09:00
parent e16d3c823b
commit f93b535f70
3 changed files with 16 additions and 7 deletions

View File

@@ -173,8 +173,13 @@ diffview = {
addCellsInline(node, b++, n++, baseTextLines, change);
}
} else {
b = addCells(node, b, be, baseTextLines, change);
n = addCells(node, n, ne, newTextLines, change);
var changeBase = change, changeNew = change;
if (change === "replace") {
if (b < be) changeBase = "delete";
if (n < ne) changeNew = "insert";
}
b = addCells(node, b, be, baseTextLines, changeBase);
n = addCells(node, n, ne, newTextLines, changeNew);
}
}