[meld] Fix loop on replace all



commit 6af0706ad96cf07572bd6b0aaf716e3807c614b9
Author: Louis des Landes <louis psykar com>
Date:   Mon May 19 22:20:49 2014 +1000

    Fix loop on replace all
    
    https://bugzilla.gnome.org/show_bug.cgi?id=729758

 meld/ui/findbar.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/meld/ui/findbar.py b/meld/ui/findbar.py
index 0012d9d..135f8f7 100644
--- a/meld/ui/findbar.py
+++ b/meld/ui/findbar.py
@@ -106,7 +106,10 @@ class FindBar(gnomeglade.Component):
         saved_insert = buf.create_mark(
             None, buf.get_iter_at_mark(buf.get_insert()), True)
         buf.begin_user_action()
-        while self._find_text(0):
+        # Seek to the start
+        buf.place_cursor(buf.get_start_iter())
+        # Can't wrap or end up looping.
+        while self._find_text(start_offset=0, wrap=False):
             buf.delete_selection(False, False)
             buf.insert_at_cursor(self.replace_entry.get_text())
         buf.end_user_action()


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