diff --git a/ChangeLog b/ChangeLog index 75d161bcd5e873b71856cd4d2469cfb2da17f871..3dfe9ed0363dd0c02bd6cbcc65233db8fe13b4af 100644 --- a/ChangeLog +++ b/ChangeLog @@ -290,8 +290,8 @@ CVS code - flag, and add new parameter needle_len (used to return the length of the match). (DLR) do_replace_loop() - - Miscellaneous cleanups: set current to real_current and - current_x to current_x_save, only turn the mark off and call + - Miscellaneous cleanups: treat real_current as current and + real_current_x as current_x, only turn the mark off and call edit_refresh() if the mark was originally on, and make length_change a ssize_t. (DLR) - Return ssize_t instead of int. (DLR) diff --git a/src/search.c b/src/search.c index bb4d58b90c5f6845db6bad684dd77aa717f09368..fb775b69cd04a349d5f4c618490678d0d2918303 100644 --- a/src/search.c +++ b/src/search.c @@ -671,8 +671,7 @@ ssize_t do_replace_loop(const char *needle, const filestruct { ssize_t numreplaced = -1; size_t match_len; - size_t pww_save = placewewant, current_x_save = *real_current_x; - const filestruct *current_save = real_current; + size_t pww_save = placewewant; bool replaceall = FALSE; #ifdef HAVE_REGEX_H /* The starting-line match and bol/eol regex flags. */ @@ -713,7 +712,7 @@ ssize_t do_replace_loop(const char *needle, const filestruct #else FALSE #endif - , current_save, current_x_save, needle, &match_len)) { + , real_current, *real_current_x, needle, &match_len)) { int i = 0; @@ -735,7 +734,7 @@ ssize_t do_replace_loop(const char *needle, const filestruct #endif if (!replaceall) { - edit_redraw(current_save, pww_save); + edit_redraw(real_current, pww_save); pww_save = placewewant; }