2016-03-31 Benno Schulenberg <bensberg@justemail.net>
2016-03-31 Benno Schulenberg <bensberg@justemail.net>
- * src/text.c (do_int_spell_fix): Replace a fake 'while' and delete
- a redundant 'if' -- we searched for whole words only, so it will be.
+ * src/text.c (do_int_spell_fix): Replace a fake 'while', delete a
+ redundant 'if', rename a variable, and adjust whitespace.
2016-03-30 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (do_replace_loop, go_looking, findnextstr): Report
2016-03-30 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (do_replace_loop, go_looking, findnextstr): Report
filestruct *edittop_save = openfile->edittop;
filestruct *current_save = openfile->current;
/* Save where we are. */
filestruct *edittop_save = openfile->edittop;
filestruct *current_save = openfile->current;
/* Save where we are. */
- bool canceled = FALSE;
- /* The inverse of this function's return value. */
+ bool proceed = TRUE;
+ /* The return value of this function. */
bool result;
/* The return value of searching for a misspelled word. */
unsigned stash[sizeof(flags) / sizeof(flags[0])];
bool result;
/* The return value of searching for a misspelled word. */
unsigned stash[sizeof(flags) / sizeof(flags[0])];
strnlenpt(openfile->current->data,
openfile->current_x + match_len) - xplustabs(), FALSE);
strnlenpt(openfile->current->data,
openfile->current_x + match_len) - xplustabs(), FALSE);
- spotlight(TRUE, exp_word);
+ spotlight(TRUE, exp_word);
/* Let the user supply a correctly spelled alternative. */
/* Let the user supply a correctly spelled alternative. */
- canceled = (do_prompt(FALSE,
+ proceed = (do_prompt(FALSE,
#ifndef DISABLE_HISTORIES
#ifndef DISABLE_HISTORIES
- edit_refresh, _("Edit a replacement")) == -1);
+ edit_refresh, _("Edit a replacement")) != -1);
- spotlight(FALSE, exp_word);
+ spotlight(FALSE, exp_word);
/* If a replacement was given, go through all occurrences. */
/* If a replacement was given, go through all occurrences. */
- if (!canceled && strcmp(word, answer) != 0) {
- openfile->current_x--;
- do_replace_loop(TRUE, openfile->current,
- &openfile->current_x, word);
- }
+ if (proceed && strcmp(word, answer) != 0) {
+ openfile->current_x--;
+ do_replace_loop(TRUE, openfile->current,
+ &openfile->current_x, word);
+ }
/* Restore the settings of the global flags. */
memcpy(flags, stash, sizeof(flags));
/* Restore the settings of the global flags. */
memcpy(flags, stash, sizeof(flags));
}
/* Internal (integrated) spell checking using the spell program,
}
/* Internal (integrated) spell checking using the spell program,