tweaks: set the correct flags just once for each spell-fixing session
parent
faa0eb991e
commit
553940760e
12
src/text.c
12
src/text.c
|
@ -2544,11 +2544,6 @@ bool fix_spello(const char *word)
|
||||||
size_t top_x, bot_x;
|
size_t top_x, bot_x;
|
||||||
#endif
|
#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 the current search string, then set it to the misspelled word. */
|
||||||
save_search = last_search;
|
save_search = last_search;
|
||||||
last_search = mallocstrcpy(NULL, word);
|
last_search = mallocstrcpy(NULL, word);
|
||||||
|
@ -2767,9 +2762,14 @@ const char *do_int_speller(const char *tempfile_name)
|
||||||
*read_buff_ptr = '\0';
|
*read_buff_ptr = '\0';
|
||||||
close(uniq_fd[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;
|
read_buff_word = read_buff_ptr = read_buff;
|
||||||
|
|
||||||
|
/* Process each of the misspelled words. */
|
||||||
while (*read_buff_ptr != '\0') {
|
while (*read_buff_ptr != '\0') {
|
||||||
if ((*read_buff_ptr == '\r') || (*read_buff_ptr == '\n')) {
|
if ((*read_buff_ptr == '\r') || (*read_buff_ptr == '\n')) {
|
||||||
*read_buff_ptr = '\0';
|
*read_buff_ptr = '\0';
|
||||||
|
|
Loading…
Reference in New Issue