* src/winio.c (statusbar): Don't bother putting back the cursor in
the edit window, as it is off anyway, and will be placed back in the
main loop. This prevents a segfault when trying to open a directory.
+ * src/search.c (findnextstr): Provide feedback when searching takes
+ longer than roughly half a second (on average).
2016-03-23 Benno Schulenberg <bensberg@justemail.net>
* src/search.c (findnextstr): Prevent the internal spell checker from
{
size_t found_len;
/* The length of the match we find. */
+ int feedback = 0;
+ /* When bigger than zero, show and wipe the "Searching..." message. */
ssize_t current_y_find = openfile->current_y;
filestruct *fileptr = openfile->current;
const char *rev_start = fileptr->data, *found = NULL;
statusbar(_("Cancelled"));
return FALSE;
}
+
+ if (++feedback > 0)
+ statusbar(_("Searching..."));
}
/* Search for the needle in the current line. */
current_y_find = 0;
}
statusbar(_("Search Wrapped"));
+ /* Delay the "Searching..." message for at least two seconds. */
+ feedback = -2;
}
/* If we've reached the original starting line, take note. */
if (match_len != NULL)
*match_len = found_len;
+ if (feedback > 0)
+ blank_statusbar();
+
return TRUE;
}