the search prompt to the "Go To Line" prompt, since the
toggling works both ways now and non-numeric text shouldn't be
lost when going only one of those ways. (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
+ edit_refresh() if the mark was originally on, and make
+ length_change a ssize_t. (DLR)
findnextstr()
- Take the no_sameline parameter after can_display_wrap and
wholewords, not after all other parameters. (DLR)
}
/* Step through each replace word and prompt user before replacing.
- * Parameters real_current and real_current_x are needed by the internal
- * speller, to allow the cursor position to be updated when a word
- * before the cursor is replaced by a shorter word.
+ * Parameters real_current and real_current_x are needed in order to
+ * allow the cursor position to be updated when a word before the cursor
+ * is replaced by a shorter word.
*
* needle is the string to seek. We replace it with answer. Return -1
* if needle isn't found, else the number of replacements performed. */
size_t *real_current_x, bool wholewords)
{
int numreplaced = -1;
- size_t old_pww = placewewant, current_x_save = current_x;
- const filestruct *current_save = current;
+ size_t old_pww = placewewant, current_x_save = *real_current_x;
+ const filestruct *current_save = real_current;
bool replaceall = FALSE;
#ifdef HAVE_REGEX_H
/* The starting-line match and bol/eol regex flags. */
#ifndef NANO_SMALL
bool old_mark_set = ISSET(MARK_ISSET);
- UNSET(MARK_ISSET);
- edit_refresh();
+ if (old_mark_set) {
+ UNSET(MARK_ISSET);
+ edit_refresh();
+ }
#endif
while (findnextstr(TRUE, wholewords,
if (i > 0 || replaceall) { /* Yes, replace it!!!! */
char *copy;
- int length_change;
+ ssize_t length_change;
if (i == 2)
replaceall = TRUE;