diff --git a/ChangeLog b/ChangeLog index f3121328..cb4489e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -7,6 +7,8 @@ in the surrounding code, for consistency. * src/browser.c (findnextfile_wrap_reset): Elide this function, and rename 'search_last_file' to 'came_full_circle'. + * src/browser.c (filesearch_init, do_fileresearch): Avoid setting + 'focusing' when searching only for filenames. 2015-04-05 Benno Schulenberg * doc/texinfo/nano.texi: Expand on nano's features, condense the diff --git a/src/browser.c b/src/browser.c index 4fe2269c..82790107 100644 --- a/src/browser.c +++ b/src/browser.c @@ -724,7 +724,8 @@ int filesearch_init(void) if (backupstring == NULL) backupstring = mallocstrcpy(NULL, ""); - search_init_globals(); + if (last_search == NULL) + last_search = mallocstrcpy(NULL, ""); if (last_search[0] != '\0') { char *disp = display_string(last_search, 0, COLS / 3, FALSE); @@ -877,7 +878,8 @@ void do_fileresearch(void) size_t begin = selected; bool didfind; - search_init_globals(); + if (last_search == NULL) + last_search = mallocstrcpy(NULL, ""); if (last_search[0] != '\0') { came_full_circle = FALSE;