commit 553940760e2e91fb13f599d0010a31c0b6ee5d59
parent faa0eb991ef418ecf70425ed3763458281584c63
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 25 Apr 2018 12:27:01 +0200
tweaks: set the correct flags just once for each spell-fixing session
Diffstat:
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -2544,11 +2544,6 @@ bool fix_spello(const char *word)
size_t top_x, bot_x;
#endif
- /* Do the spell checking case sensitive, forward, and without regexes. */
- SET(CASE_SENSITIVE);
- UNSET(BACKWARDS_SEARCH);
- UNSET(USE_REGEXP);
-
/* Save the current search string, then set it to the misspelled word. */
save_search = last_search;
last_search = mallocstrcpy(NULL, word);
@@ -2767,9 +2762,14 @@ const char *do_int_speller(const char *tempfile_name)
*read_buff_ptr = '\0';
close(uniq_fd[0]);
- /* Process the spelling errors. */
+ /* Do any replacements case sensitive, forward, and without regexes. */
+ SET(CASE_SENSITIVE);
+ UNSET(BACKWARDS_SEARCH);
+ UNSET(USE_REGEXP);
+
read_buff_word = read_buff_ptr = read_buff;
+ /* Process each of the misspelled words. */
while (*read_buff_ptr != '\0') {
if ((*read_buff_ptr == '\r') || (*read_buff_ptr == '\n')) {
*read_buff_ptr = '\0';