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-d3aeb78583b8master
parent
2a7a9a242f
commit
1d8fa1fa90
13
nano.c
13
nano.c
|
@ -1584,7 +1584,7 @@ int do_int_spell_fix(const char *word)
|
||||||
char *save_search;
|
char *save_search;
|
||||||
char *save_replace;
|
char *save_replace;
|
||||||
filestruct *begin;
|
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
|
#ifndef NANO_SMALL
|
||||||
int mark_set;
|
int mark_set;
|
||||||
#endif
|
#endif
|
||||||
|
@ -1597,6 +1597,9 @@ int do_int_spell_fix(const char *word)
|
||||||
reverse_search_set = ISSET(REVERSE_SEARCH);
|
reverse_search_set = ISSET(REVERSE_SEARCH);
|
||||||
UNSET(REVERSE_SEARCH);
|
UNSET(REVERSE_SEARCH);
|
||||||
|
|
||||||
|
case_sens_set = ISSET(CASE_SENSITIVE);
|
||||||
|
SET(CASE_SENSITIVE);
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
/* Make sure the marking highlight is off during Spell Check */
|
/* Make sure the marking highlight is off during Spell Check */
|
||||||
mark_set = ISSET(MARK_ISSET);
|
mark_set = ISSET(MARK_ISSET);
|
||||||
|
@ -1618,8 +1621,6 @@ int do_int_spell_fix(const char *word)
|
||||||
|
|
||||||
search_last_line = FALSE;
|
search_last_line = FALSE;
|
||||||
|
|
||||||
edit_update(fileage, TOP);
|
|
||||||
|
|
||||||
while (1) {
|
while (1) {
|
||||||
/* make sure word is still mis-spelt (i.e. when multi-errors) */
|
/* make sure word is still mis-spelt (i.e. when multi-errors) */
|
||||||
if (findnextstr(TRUE, FALSE, fileage, beginx_top, word) != NULL) {
|
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))
|
if (!is_whole_word(current_x, current->data, word))
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
edit_refresh();
|
||||||
do_replace_highlight(TRUE, word);
|
do_replace_highlight(TRUE, word);
|
||||||
|
|
||||||
/* allow replace word to be corrected */
|
/* allow replace word to be corrected */
|
||||||
|
@ -1661,14 +1663,15 @@ int do_int_spell_fix(const char *word)
|
||||||
if (reverse_search_set)
|
if (reverse_search_set)
|
||||||
SET(REVERSE_SEARCH);
|
SET(REVERSE_SEARCH);
|
||||||
|
|
||||||
|
if (!case_sens_set)
|
||||||
|
UNSET(CASE_SENSITIVE);
|
||||||
|
|
||||||
#ifndef NANO_SMALL
|
#ifndef NANO_SMALL
|
||||||
/* restore marking highlight */
|
/* restore marking highlight */
|
||||||
if (mark_set)
|
if (mark_set)
|
||||||
SET(MARK_ISSET);
|
SET(MARK_ISSET);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
edit_update(current, CENTER);
|
|
||||||
|
|
||||||
if (i == -1)
|
if (i == -1)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue