[meld] Fix incorrect modified indicator on first undo (closes bgo#658022)



commit 7cf7d4f663bb9e329a2ee877975eb257260fcdc4
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Sun Sep 4 08:04:19 2011 +1000

    Fix incorrect modified indicator on first undo (closes bgo#658022)
    
    The check for a checkpointed (i.e., saved) buffer was incorrect for the
    very first undo in a sequence. Due to a None-handling mishap, a
    checkpoint that should have ranged from 0:0 always ranged from 0:1.

 meld/undo.py |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/meld/undo.py b/meld/undo.py
index ccad9a9..1ce925d 100644
--- a/meld/undo.py
+++ b/meld/undo.py
@@ -193,7 +193,9 @@ class UndoSequence(gobject.GObject):
         start, end = self.checkpoints.get(buf, (None, None))
         if start is None:
             return False
-        return start <= self.next_redo <= (end or len(self.actions))
+        if end is None:
+            end = len(self.actions)
+        return start <= self.next_redo <= end
 
     def begin_group(self):
         """Group several actions into a single logical action.



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