[meld] filediff: Fix refactoring snafu



commit 750cf6759e190805db59707c7120d263604a67a9
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Wed Jul 13 07:16:52 2016 +1000

    filediff: Fix refactoring snafu

 meld/filediff.py |    9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 098b676..99276bc 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1281,6 +1281,11 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
                 def apply_highlight(
                         bufs, tags, start_marks, end_marks, texts, to_pane,
                         chunk, matches):
+                    starts = [bufs[0].get_iter_at_mark(start_marks[0]),
+                              bufs[1].get_iter_at_mark(start_marks[1])]
+                    ends = [bufs[0].get_iter_at_mark(end_marks[0]),
+                            bufs[1].get_iter_at_mark(end_marks[1])]
+
                     bufs[0].delete_mark(start_marks[0])
                     bufs[0].delete_mark(end_marks[0])
                     bufs[1].delete_mark(start_marks[1])
@@ -1289,10 +1294,6 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
                     if not self.linediffer.has_chunk(to_pane, chunk):
                         return
 
-                    starts = [bufs[0].get_iter_at_mark(start_marks[0]),
-                              bufs[1].get_iter_at_mark(start_marks[1])]
-                    ends = [bufs[0].get_iter_at_mark(end_marks[0]),
-                            bufs[1].get_iter_at_mark(end_marks[1])]
                     text1 = bufs[0].get_text(starts[0], ends[0], False)
                     text1 = text_type(text1, 'utf8')
                     textn = bufs[1].get_text(starts[1], ends[1], False)


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