mirror of
https://github.com/kennethreitz-archive/gitx.git
synced 2026-06-05 23:40:18 +00:00
DiffView: Hilight trailing whitespace
This commit is contained in:
@@ -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>";
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user