[meld] Draw indicators for syncpoints



commit 79d075c338aab940b97d9ced7d497e6202921230
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Thu Apr 4 06:37:58 2013 +1000

    Draw indicators for syncpoints
    
    Note that there is no indication of which syncpoint lines up with what;
    without custom SourceView gutters or similar, this is unlikely to
    happen.

 data/gtkrc       |    2 ++
 meld/filediff.py |    8 ++++++++
 2 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/data/gtkrc b/data/gtkrc
index 452c6d6..56bc0b0 100644
--- a/data/gtkrc
+++ b/data/gtkrc
@@ -27,6 +27,8 @@ style "meld-color-scheme"
     color["unknown-text"] = "#888888"
 
     color["current-line-highlight"] = "#ffff00"
+
+    color["syncpoint-outline"] = "#555555"
 }
 widget "meldapp.*" style : lowest "meld-color-scheme"
 
diff --git a/meld/filediff.py b/meld/filediff.py
index e4ca64a..49e2aa7 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -315,6 +315,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
                             "conflict": lookup("conflict-outline", "#f0768b"),
                             "replace" : lookup("replace-outline", "#8bbff3")}
         self.highlight_color = lookup("highlight-bg", "#ffff00")
+        self.syncpoint_color = lookup("syncpoint-outline", "#555555")
 
         for associated in self.diffmap + self.linkmap:
             associated.set_color_scheme([self.fill_colors, self.line_colors])
@@ -1355,6 +1356,13 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
             context.paint_with_alpha(0.25)
             context.restore()
 
+        for syncpoint in [p[pane] for p in self.syncpoints]:
+            if bounds[0] <= syncpoint <= bounds[1]:
+                ypos = textview.get_y_for_line_num(syncpoint) - visible.y
+                context.rectangle(-0.5, ypos - 0.5, width + 1, 1)
+                context.set_source_color(self.syncpoint_color)
+                context.stroke()
+
         current_time = glib.get_current_time()
         new_anim_chunks = []
         for c in self.animating_chunks[pane]:


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