diff --git a/ChangeLog b/ChangeLog index b7e299005c1a1837bcc15c37d0538219bdad228c..7b871473cc72f3354ed1f6796f475735994fd135 100644 --- a/ChangeLog +++ b/ChangeLog @@ -29,6 +29,8 @@ CVS code - do_char() - Run edit_refresh() if ENABLE_COLOR is defined so adding multi-liners will update (e.g. /* in C). + do_int_spell_fix() + - Temporarily unset REVERSE_SEARCH if it's set (Rocco Corsi). do_suspend() - Call tcsetattr() to restore the old terminal settings, so tcsh can use ^C after suspend for example (fixes BUG #68). diff --git a/nano.c b/nano.c index 37fa6a529ca2ca9edd4b577f5c9212be0a2bf2bb..b6eaf90ca0044bea0f636cb84b1591b7391b6840 100644 --- a/nano.c +++ b/nano.c @@ -1448,12 +1448,16 @@ int do_int_spell_fix(char *word) { char *prevanswer = NULL, *save_search = NULL, *save_replace = NULL; filestruct *begin; - int i = 0, j = 0, beginx, beginx_top; + int i = 0, j = 0, beginx, beginx_top, reverse_search_set; /* save where we are */ begin = current; beginx = current_x + 1; + /* Make sure Spell Check goes forward only */ + reverse_search_set = ISSET(REVERSE_SEARCH); + UNSET(REVERSE_SEARCH); + /* save the current search/replace strings */ search_init_globals(); save_search = mallocstrcpy(save_search, last_search); @@ -1512,6 +1516,10 @@ int do_int_spell_fix(char *word) current = begin; current_x = beginx - 1; + /* restore Search/Replace direction */ + if (reverse_search_set) + SET(REVERSE_SEARCH); + edit_update(current, CENTER); if (i == -1)