[gitg] Show diff type in gutter



commit d4d1d45952989f687c9d81040d339a14f0cfd0a4
Author: Jesse van den Kieboom <jessevdk gmail com>
Date:   Thu Jan 2 13:59:20 2014 +0100

    Show diff type in gutter

 libgitg/resources/diff-view-html-builder.js |   11 ++++++++++-
 libgitg/resources/diff-view.css             |    5 +++--
 libgitg/resources/diff-view.html            |    3 ++-
 3 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/libgitg/resources/diff-view-html-builder.js b/libgitg/resources/diff-view-html-builder.js
index 83f1a87..4f250c4 100644
--- a/libgitg/resources/diff-view-html-builder.js
+++ b/libgitg/resources/diff-view-html-builder.js
@@ -21,6 +21,7 @@ function diff_file(file, lnstate, data)
                        file_body += '<tr class="context">\
                                <td class="gutter old">' + lnstate.gutterdots + '</td>\
                                <td class="gutter new">' + lnstate.gutterdots + '</td>\
+                               <td class="gutter type">&nbsp;</td>\
                                <td></td>\
                        </tr>';
                        continue;
@@ -36,6 +37,7 @@ function diff_file(file, lnstate, data)
                file_body += '<tr class="hunk_header">\
                        <td class="gutter old">' + lnstate.gutterdots + '</td> \
                        <td class="gutter new">' + lnstate.gutterdots + '</td> \
+                       <td class="gutter type">&nbsp;</td> \
                        <td class="hunk_header">' + hunk_header + '</td> \
                </tr>';
 
@@ -78,13 +80,20 @@ function diff_file(file, lnstate, data)
                                        row += 'context"> \
                                                <td class="gutter old"></td> \
                                                <td class="gutter new"></td>';
-                                               l.content = l.content.substr(1, l.content.length);
+                                       l.content = l.content.substr(1, l.content.length);
                                break;
                                default:
+                                       o = ' ';
                                        row += '">';
                                break;
                        }
 
+                       if (o == ' ')
+                       {
+                               o = '&nbsp;';
+                       }
+
+                       row += '<td class="gutter type">' + o + '</td>';
                        row += '<td class="code">' + html_escape(l.content).replace(/\t/g, tabrepl) + '</td>';
 
                        row += '</tr>';
diff --git a/libgitg/resources/diff-view.css b/libgitg/resources/diff-view.css
index 2104742..77e73f3 100644
--- a/libgitg/resources/diff-view.css
+++ b/libgitg/resources/diff-view.css
@@ -188,11 +188,12 @@ div#diff div.file table td {
   vertical-align: top;
 }
 
-div#diff div.file table td.gutter.new {
+div#diff div.file table td.gutter.type {
   border-right: 3px solid #d3d7cf;
+  padding: 0px 3px 0px 3px;
 }
 
-div#diff div.file table tr.hunk_header td.gutter.new {
+div#diff div.file table tr.hunk_header td.gutter.type {
   border: 0;
 }
 
diff --git a/libgitg/resources/diff-view.html b/libgitg/resources/diff-view.html
index d8bd96f..b7456ab 100644
--- a/libgitg/resources/diff-view.html
+++ b/libgitg/resources/diff-view.html
@@ -25,11 +25,12 @@
           <colgroup>
             <col width="0">
             <col width="0">
+            <col width="0">
             <col width="100%">
           </colgroup>
           <tbody>
             <tr class="file_header">
-              <td colspan="3">
+              <td colspan="4">
                 <span class="expander">-</span>
                 <!-- ${FILE_STATS} -->
                 <span class="file_path"><!-- ${FILE_PATH} --></span>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]