[meld] gutterrendererchunk: Return whether we're in a chunk for the renderer



commit 31d9bd893cc81577edab95ea3882977dea46ed56
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Sep 25 08:36:00 2016 +1000

    gutterrendererchunk: Return whether we're in a chunk for the renderer

 meld/gutterrendererchunk.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/meld/gutterrendererchunk.py b/meld/gutterrendererchunk.py
index 20855fe..e11330e 100644
--- a/meld/gutterrendererchunk.py
+++ b/meld/gutterrendererchunk.py
@@ -102,9 +102,10 @@ class MeldGutterRenderer(object):
     def query_chunks(self, start, end, state):
         line = start.get_line()
         chunk_index = self.linediffer.locate_chunk(self.from_pane, line)[0]
+        in_chunk = chunk_index is not None
 
         chunk = None
-        if chunk_index is not None:
+        if in_chunk:
             chunk = self.linediffer.get_chunk(
                 chunk_index, self.from_pane, self.to_pane)
 
@@ -120,6 +121,7 @@ class MeldGutterRenderer(object):
             background_rgba = get_background_rgba(self)
         self._chunk = chunk
         self.set_background(background_rgba)
+        return in_chunk
 
 
 class GutterRendererChunkAction(


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