1
1

tweaks: remove an old fix that was made superfluous by a recent fix

Commit 43d94692 fixed a miscoloring bug [1] by doing proper backtracking
for multiline regexes.  But this change also solves an older miscoloring
issue [2] without needing to recalculate all the multiline data.  So...
just drop the old fix.  (This isn't perfect: it's probably possible to
cook up a replacement scheme where things get miscolored, but... until
then, this is good enough.)

  [1] https://savannah.gnu.org/bugs/?59948
  [2] https://savannah.gnu.org/bugs/?58481

Also, there is no need to set 'refresh_needed' in do_replace_loop(),
because each replacement prompt will call edit_refresh() anyway, and
the functions that call do_replace_loop() will set it afterward.
Этот коммит содержится в:
Benno Schulenberg 2021-01-29 16:34:04 +01:00
родитель a8e2a24f60
Коммит d3fbc4d498

Просмотреть файл

@ -668,13 +668,6 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
#ifndef NANO_TINY
if (ISSET(SOFTWRAP))
openfile->current->extrarows = extra_chunks_in(openfile->current);
#endif
#ifdef ENABLE_COLOR
/* Check whether the replacement requires a change in the coloring. */
check_the_multis(openfile->current);
if (refresh_needed && !replaceall)
precalc_multicolorinfo();
#endif
set_modified();
as_an_at = TRUE;
@ -685,11 +678,6 @@ ssize_t do_replace_loop(const char *needle, bool whole_word_only,
if (numreplaced == -1)
not_found_msg(needle);
#ifdef ENABLE_COLOR
if (refresh_needed)
precalc_multicolorinfo();
#endif
#ifndef NANO_TINY
openfile->mark = was_mark;
#endif