DiffView: Hilight trailing whitespace

This commit is contained in:
Pieter de Bie
2008-10-03 21:26:38 +02:00
parent 57d5db9d49
commit a8cb5905ea
2 changed files with 10 additions and 1 deletions
+5 -1
View File
@@ -18,7 +18,7 @@ var highlightDiffs = function() {
if (l.length > 250)
l = l.substring(0, 250);
l = l.gsub("\t", " ");
l = l.gsub("\t", " ");
if (l.startsWith("diff")) {
line1 += "\n";
@@ -43,6 +43,10 @@ var highlightDiffs = function() {
}
if (l.startsWith("+")) {
// Highlight trailing whitespace
if (m = l.match(/([\t ]+)$/))
l = l.replace(/[\t ]+$/, "<span class='whitespace'>" + m[1] + "</span>");
line1 += "\n";
line2 += ++hunk_start_line_2 + "\n";
diffContent += "<div class='addline'>" + l + "</div>";
+5
View File
@@ -39,6 +39,11 @@ pre code {
border-left: 5px solid black;
}
.whitespace {
background-color: rgba(255,0,0,0.5);
}
table.diff {
margin-top: 15px;
margin-left: 5px;