[meld] filediff: Fix sensitivity setting for missing chunks



commit 945014f5e9c1164d067300082069c17275ea4c57
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Wed Jan 3 06:37:55 2018 +1000

    filediff: Fix sensitivity setting for missing chunks
    
    The previous "is not None" logic existed so that we didn't get e.g.,
    None out of the logical shortcut. We need a boolean here, so we'll just
    do that instead.

 meld/filediff.py | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index d0dad397..a98a3921 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -435,10 +435,10 @@ class FileDiff(MeldDoc, Component):
                 chunk2 = None
                 if self.num_panes == 3:
                     chunk2 = self.linediffer.get_chunk(chunk_id, 1, 2)
-                left_mid_exists = chunk0 and chunk0[1] != chunk0[2]
-                left_exists = chunk0 and chunk0[3] != chunk0[4]
-                right_mid_exists = chunk2 and chunk2[1] != chunk2[2]
-                right_exists = chunk2 and chunk2[3] != chunk2[4]
+                left_mid_exists = bool(chunk0 and chunk0[1] != chunk0[2])
+                left_exists = bool(chunk0 and chunk0[3] != chunk0[4])
+                right_mid_exists = bool(chunk2 and chunk2[1] != chunk2[2])
+                right_exists = bool(chunk2 and chunk2[3] != chunk2[4])
                 push_left = editable_left
                 push_right = editable_right
                 pull_left = editable and left_exists


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