diff --git a/src/main/twirl/helper/diff.scala.html b/src/main/twirl/helper/diff.scala.html index 598841c..8d0cd88 100644 --- a/src/main/twirl/helper/diff.scala.html +++ b/src/main/twirl/helper/diff.scala.html @@ -41,7 +41,7 @@
+ | @if(diff.changeType == ChangeType.COPY || diff.changeType == ChangeType.RENAME){ @diff.oldPath -> @diff.newPath @if(newCommitId.isDefined){ @@ -69,7 +69,7 @@ |
---|---|
+ | @if(diff.newContent != None || diff.oldContent != None){ diff --git a/src/main/webapp/assets/common/css/gitbucket.css b/src/main/webapp/assets/common/css/gitbucket.css index fecaa36..3d29584 100644 --- a/src/main/webapp/assets/common/css/gitbucket.css +++ b/src/main/webapp/assets/common/css/gitbucket.css @@ -847,20 +847,24 @@ /****************************************************************************/ /* Diff */ /****************************************************************************/ -table.inlinediff { +table.diff { font-size: 12px; font-family: Monaco, Menlo, Consolas, "Courier New", monospace; width: 100%; } -table.inlinediff thead { +table.diff thead { display: none; } -td.insert, td.equal, td.delete { +table.inlinediff td.insert, table.inlinediff td.equal, table.inlinediff td.delete { width: 100%; } +td.insert, td.equal, td.delete, td.empty { + width: 50%; +} + /****************************************************************************/ /* Repository Settings */ /****************************************************************************/ diff --git a/src/main/webapp/assets/vendors/jsdifflib/diffview.js b/src/main/webapp/assets/vendors/jsdifflib/diffview.js index a228a34..0a36c27 100644 --- a/src/main/webapp/assets/vendors/jsdifflib/diffview.js +++ b/src/main/webapp/assets/vendors/jsdifflib/diffview.js @@ -173,8 +173,13 @@ 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); } } |