Commit 3c8647e7 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

search: terminate the loop a tiny bit earlier when spell checking

The internal spell checker starts searching/replacing always at the top
of the buffer, so reaching the end of the buffer means we're done with
the current search/replace.  This prevents the "Search Wrapped" message
from flashing over the statusbar at the end of a spelling replacement.
No related merge requests found
Showing with 8 additions and 7 deletions
+8 -7
......@@ -308,13 +308,6 @@ int findnextstr(
#ifndef DISABLE_SPELLER
bool found_whole = FALSE;
/* Is this potential match a whole word? */
/* When we're spell-checking, don't search in the starting line
* again -- there is no need: we started at x = 0. */
if (whole_word_only && came_full_circle) {
disable_nodelay();
return 0;
}
#endif
/* Remember the length of the potential match. */
found_len =
......@@ -359,12 +352,20 @@ int findnextstr(
/* If we've reached the start or end of the buffer, wrap around. */
if (fileptr == NULL) {
#ifndef DISABLE_SPELLER
/* When we're spell-checking, end-of-buffer means we're done. */
if (whole_word_only) {
disable_nodelay();
return 0;
}
#endif
#ifndef NANO_TINY
if (ISSET(BACKWARDS_SEARCH))
fileptr = openfile->filebot;
else
#endif
fileptr = openfile->fileage;
statusbar(_("Search Wrapped"));
/* Delay the "Searching..." message for at least two seconds. */
feedback = -2;
......
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