replacing: detect when the whole region has already been covered
Even when a match falls within the marked region, this does not mean that it is a true match when already the whole file has been searched, because then this is the second time we find this match. This fixes https://savannah.gnu.org/bugs/?50158.master
parent
94e563232e
commit
437cb410e9
|
@ -623,7 +623,7 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
|
|||
if (old_mark_set) {
|
||||
/* When we've found an occurrence outside of the marked region,
|
||||
* stop the fanfare. */
|
||||
if (openfile->current->lineno > bot->lineno ||
|
||||
if (came_full_circle || openfile->current->lineno > bot->lineno ||
|
||||
openfile->current->lineno < top->lineno ||
|
||||
(openfile->current == bot && openfile->current_x + match_len > bot_x) ||
|
||||
(openfile->current == top && openfile->current_x < top_x))
|
||||
|
|
Loading…
Reference in New Issue