[meld] ui.findbar: Use replace all functionality from SearchContext
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] ui.findbar: Use replace all functionality from SearchContext
- Date: Sat, 11 Oct 2014 21:28:26 +0000 (UTC)
commit a8f1223bb2014bd000c36bbb7806ba022a34a4a2
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sun Oct 12 06:48:21 2014 +1000
ui.findbar: Use replace all functionality from SearchContext
meld/ui/findbar.py | 9 +--------
1 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/meld/ui/findbar.py b/meld/ui/findbar.py
index c7abbbe..5dc3ab7 100644
--- a/meld/ui/findbar.py
+++ b/meld/ui/findbar.py
@@ -114,14 +114,7 @@ class FindBar(gnomeglade.Component):
buf = self.textview.get_buffer()
saved_insert = buf.create_mark(
None, buf.get_iter_at_mark(buf.get_insert()), True)
- buf.begin_user_action()
- # 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()
+ self.search_context.replace_all(self.replace_entry.get_text(), -1)
if not saved_insert.get_deleted():
buf.place_cursor(buf.get_iter_at_mark(saved_insert))
self.textview.scroll_to_mark(
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]