]> git.wh0rd.org Git - nano.git/commitdiff
Avoiding to set 'focusing' when searching for filenames;
authorBenno Schulenberg <bensberg@justemail.net>
Tue, 7 Apr 2015 11:04:32 +0000 (11:04 +0000)
committerBenno Schulenberg <bensberg@justemail.net>
Tue, 7 Apr 2015 11:04:32 +0000 (11:04 +0000)
it should be set only when searching/replacing text.

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5181 35c25a1d-7b9e-4130-9fde-d3aeb78583b8

ChangeLog
src/browser.c

index f3121328b2859cf127af000ea33bb9ad7ba64520..cb4489e27a9195d7714f0a24ce64214cb854b862 100644 (file)
--- 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  <bensberg@justemail.net>
        * doc/texinfo/nano.texi: Expand on nano's features, condense the
index 4fe2269cb958ddcf40e5202ca038d32f23329b46..827901070b45a204ec8a33dd5d0cee21a988dc58 100644 (file)
@@ -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;