(there are no toggles here) and tweak some others.
* src/search.c (do_search, do_research): Use the same variable as
in the surrounding code, for consistency.
+ * src/browser.c (findnextfile_wrap_reset): Elide this function,
+ and rename 'search_last_file' to 'came_full_circle'.
2015-04-05 Benno Schulenberg <bensberg@justemail.net>
* doc/texinfo/nano.texi: Expand on nano's features, condense the
static size_t selected = 0;
/* The currently selected filename in the list. This variable
* is zero-based. */
-static bool search_last_file = FALSE;
- /* Have we gone past the last file while searching? */
+static bool came_full_circle = FALSE;
+ /* Have we reached the starting file again while searching? */
/* Our main file browser function. path is the tilde-expanded path we
* start browsing from. */
if (found != NULL && (!no_sameline || currselected != begin))
break;
- if (search_last_file) {
+ if (came_full_circle) {
/* We've finished processing the filenames, so get out. */
not_found_msg(needle);
return FALSE;
if (currselected == begin)
/* We've reached the original starting file. */
- search_last_file = TRUE;
+ came_full_circle = TRUE;
filetail = tail(filelist[currselected]);
return TRUE;
}
-/* Clear the flag indicating that a search reached the last file in the
- * list. We need to do this just before a new search. */
-void findnextfile_wrap_reset(void)
-{
- search_last_file = FALSE;
-}
-
/* Abort the current filename search. Clean up by setting the current
* shortcut list to the browser shortcut list, and displaying it. */
void filesearch_abort(void)
update_history(&search_history, answer);
#endif
- findnextfile_wrap_reset();
+ came_full_circle = FALSE;
didfind = findnextfile(FALSE, begin, answer);
/* Check to see if there's only one occurrence of the string and
search_init_globals();
if (last_search[0] != '\0') {
- findnextfile_wrap_reset();
+ came_full_circle = FALSE;
didfind = findnextfile(FALSE, begin, last_search);
/* Check to see if there's only one occurrence of the string and
bool browser_select_filename(const char *needle);
int filesearch_init(void);
bool findnextfile(bool no_sameline, size_t begin, const char *needle);
-void findnextfile_wrap_reset(void);
void filesearch_abort(void);
void do_filesearch(void);
void do_fileresearch(void);