Index: src/search.c =================================================================== --- src/search.c (revision 5166) +++ src/search.c (working copy) @@ -696,6 +696,10 @@ /* TRUE if (mark_begin, mark_begin_x) is the top of the mark, * FALSE if (current, current_x) is. */ +#ifndef NANO_TINY + add_undo(REPLACE); +#endif + if (old_mark_set) { /* If the mark is on, partition the filestruct so that it * contains only the marked text, set edittop to the top of the @@ -791,9 +795,6 @@ char *copy; size_t length_change; -#ifndef NANO_TINY - update_undo(REPLACE); -#endif if (i == 2) replaceall = TRUE;