[gedit-plugins/gnome-2-30] Improved handling of scrolling for replace-all command
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins/gnome-2-30] Improved handling of scrolling for replace-all command
- Date: Mon, 3 May 2010 11:44:38 +0000 (UTC)
commit facc66d97ee959309ce7900553cc1f7a6517c394
Author: Jesse van den Kieboom <jesse icecrew nl>
Date: Thu Apr 29 19:15:09 2010 +0200
Improved handling of scrolling for replace-all command
plugins/commander/modules/find/finder.py | 15 +++++++++++----
1 files changed, 11 insertions(+), 4 deletions(-)
---
diff --git a/plugins/commander/modules/find/finder.py b/plugins/commander/modules/find/finder.py
index 3abc16b..bc453f1 100644
--- a/plugins/commander/modules/find/finder.py
+++ b/plugins/commander/modules/find/finder.py
@@ -195,7 +195,7 @@ class Finder:
self.cancel()
yield commands.result.DONE
-
+
def _restore_cursor(self, mark):
buf = mark.get_buffer()
@@ -221,10 +221,16 @@ class Finder:
if not ret:
yield commands.result.DONE
-
+
+ self.scroll_back = False
+
# Then ask for the replacement string
if not self.replacestr:
try:
+ if replaceall:
+ self.scroll_back = True
+ self.select_last_result()
+
replacestr, words, modifier = (yield commands.result.Prompt('Replace with:'))
self.set_replace(replacestr)
except GeneratorExit, e:
@@ -272,10 +278,11 @@ class Finder:
buf.end_user_action()
self.cancel()
- raise e
+ raise e
if replaceall:
- self._restore_cursor(startmark)
+ if self.scroll_back:
+ self._restore_cursor(startmark)
buf.end_user_action()
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]