[meld] gutterrendererchunk: Handle missing chunks for conflict indices



commit b85930069b4f281888723107818cbbe34322b4d2
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sat Oct 8 10:21:20 2016 +1000

    gutterrendererchunk: Handle missing chunks for conflict indices

 meld/gutterrendererchunk.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 7411e0f..20855fe 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -103,10 +103,12 @@ class MeldGutterRenderer(object):
         line = start.get_line()
         chunk_index = self.linediffer.locate_chunk(self.from_pane, line)[0]
 
+        chunk = None
         if chunk_index is not None:
             chunk = self.linediffer.get_chunk(
                 chunk_index, self.from_pane, self.to_pane)
 
+        if chunk is not None:
             if chunk[1] == chunk[2]:
                 background_rgba = get_background_rgba(self)
             elif self.props.view.current_chunk_check(chunk):
@@ -114,7 +116,6 @@ class MeldGutterRenderer(object):
             else:
                 background_rgba = self.fill_colors[chunk[0]]
         else:
-            chunk = None
             # TODO: Remove when fixed in upstream GTK+
             background_rgba = get_background_rgba(self)
         self._chunk = chunk


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