From 5bbd6a30d77c42026cf860ca844e878fbb9f3cf2 Mon Sep 17 00:00:00 2001 From: Nick Treleaven Date: Thu, 25 Mar 2010 13:43:37 +0000 Subject: [PATCH] Fix wrong selection range after Replace in Selection. git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@4784 ea778897-0a13-0410-b9d1-a72fbfd435f5 --- ChangeLog | 6 ++++++ src/document.c | 2 +- src/search.c | 3 ++- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 702dd41e..5b0bbe24 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2010-03-25 Nick Treleaven + + * src/search.c, src/document.c: + Fix wrong selection range after Replace in Selection. + + 2010-03-20 Enrico Tröger * src/win32.c: diff --git a/src/document.c b/src/document.c index e571bbe0..8ebfd0ba 100644 --- a/src/document.c +++ b/src/document.c @@ -2128,7 +2128,7 @@ document_replace_range(GeanyDocument *doc, const gchar *find_text, const gchar * sci_goto_pos(sci, ttf.chrg.cpMin, TRUE); if (new_range_end != NULL) - *new_range_end = end; + *new_range_end = ttf.chrg.cpMax; } return count; } diff --git a/src/search.c b/src/search.c index 66e84a82..e72e6361 100644 --- a/src/search.c +++ b/src/search.c @@ -1876,7 +1876,8 @@ void search_find_usage(const gchar *search_text, gint flags, gboolean in_session } -/* ttf is updated to include the last match positions. +/* ttf is updated to include the last match position (ttf->chrg.cpMin) and + * the new search range end (ttf->chrg.cpMax). * Note: Normally you would call sci_start/end_undo_action() around this call. */ /* Warning: Scintilla recommends caching replacements to do all at once to avoid * performance issues with SCI_GETCHARACTERPOINTER. */