[latexila] Search: improve replace behavior
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [latexila] Search: improve replace behavior
- Date: Fri, 4 Oct 2013 15:28:47 +0000 (UTC)
commit 4025cc920b94a852592ef426ec5a7ed85e095497
Author: Sébastien Wilmet <swilmet gnome org>
Date: Fri Oct 4 17:25:21 2013 +0200
Search: improve replace behavior
If we click on the replace button, if no occurrence is selected, go to
the next occurrence. If an occurrence is selected, just replace it, do
not move to the next occurrence. So when we have replaced an occurrence,
we have the time to see if the replacement is correct, and fix it if we
are not happy with the result. I prefer this behavior.
src/search.vala | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/src/search.vala b/src/search.vala
index 0eb553f..e4054ed 100644
--- a/src/search.vala
+++ b/src/search.vala
@@ -446,13 +446,13 @@ public class SearchAndReplace : GLib.Object
try
{
- _search_context.replace (match_start, match_end, _entry_replace.text, -1);
+ if (! _search_context.replace (match_start, match_end,
+ _entry_replace.text, -1))
+ search_forward ();
}
catch (Error e)
{
/* Do nothing. An error can occur only for a regex search. */
}
-
- search_forward ();
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]