Commit 1d8fa1fa authored by Chris Allegretta's avatar Chris Allegretta
Browse files

Make speller update the screen less excessively, and switch case sensitive...

Make speller update the screen less excessively, and switch case sensitive search so we can fix individual capitalization cases of misspelled words


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1326 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 2a7a9a24
Showing with 8 additions and 5 deletions
+8 -5
......@@ -1584,7 +1584,7 @@ int do_int_spell_fix(const char *word)
char *save_search;
char *save_replace;
filestruct *begin;
int i = 0, j = 0, beginx, beginx_top, reverse_search_set;
int i = 0, j = 0, beginx, beginx_top, reverse_search_set, case_sens_set;
#ifndef NANO_SMALL
int mark_set;
#endif
......@@ -1597,6 +1597,9 @@ int do_int_spell_fix(const char *word)
reverse_search_set = ISSET(REVERSE_SEARCH);
UNSET(REVERSE_SEARCH);
case_sens_set = ISSET(CASE_SENSITIVE);
SET(CASE_SENSITIVE);
#ifndef NANO_SMALL
/* Make sure the marking highlight is off during Spell Check */
mark_set = ISSET(MARK_ISSET);
......@@ -1618,8 +1621,6 @@ int do_int_spell_fix(const char *word)
search_last_line = FALSE;
edit_update(fileage, TOP);
while (1) {
/* make sure word is still mis-spelt (i.e. when multi-errors) */
if (findnextstr(TRUE, FALSE, fileage, beginx_top, word) != NULL) {
......@@ -1628,6 +1629,7 @@ int do_int_spell_fix(const char *word)
if (!is_whole_word(current_x, current->data, word))
continue;
edit_refresh();
do_replace_highlight(TRUE, word);
/* allow replace word to be corrected */
......@@ -1661,14 +1663,15 @@ int do_int_spell_fix(const char *word)
if (reverse_search_set)
SET(REVERSE_SEARCH);
if (!case_sens_set)
UNSET(CASE_SENSITIVE);
#ifndef NANO_SMALL
/* restore marking highlight */
if (mark_set)
SET(MARK_ISSET);
#endif
edit_update(current, CENTER);
if (i == -1)
return FALSE;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment