From 4947ad83cb50ae3a6d9dc5a6c920c35109eb12bf Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 1 Jul 2014 15:42:08 +0000 Subject: [PATCH] Showing that it is possible to have case-sensitive, regular-expressive, and backwards searching in the file browser. git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@5047 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 +++ src/browser.c | 9 +++------ src/global.c | 12 ++++++------ 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 13b64702..d2b86fd8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -8,6 +8,9 @@ * src/prompt.c (do_prompt, get_prompt_string): Don't pass the menu, just set it earlier. * src/prompt.c (get_prompt_string): Group the arguments better. + * src/global.c (shortcut_init), src/browser(do_filesearch): Show + that it is possible to have case-sensitive, regular-expressive, + and backwards searching in the file browser. 2014-06-30 Mark Majeres * src/cut.c, src/global.c, src/nano.c: Rename 'cut_till_end' to diff --git a/src/browser.c b/src/browser.c index 474e0cdf..ac52e113 100644 --- a/src/browser.c +++ b/src/browser.c @@ -934,15 +934,12 @@ void do_filesearch(void) int i; bool didfind; - i = filesearch_init(); + do i = filesearch_init(); + while (i == 1); + if (i == -1) /* Cancel, blank search string, or regcomp() * failed. */ filesearch_abort(); -#if !defined(NANO_TINY) || defined(HAVE_REGEX_H) - else if (i == 1) /* Case Sensitive, Backwards, or Regexp search - * toggle. */ - do_filesearch(); -#endif if (i != 0) return; diff --git a/src/global.c b/src/global.c index 26392d65..e53a6e9a 100644 --- a/src/global.c +++ b/src/global.c @@ -733,17 +733,17 @@ void shortcut_init(void) #endif #ifndef NANO_TINY - add_to_funcs(case_sens_void, MWHEREIS|MREPLACE, + add_to_funcs(case_sens_void, MWHEREIS|MREPLACE|MWHEREISFILE, N_("Case Sens"), IFSCHELP(nano_case_msg), FALSE, VIEW); #endif #ifdef HAVE_REGEX_H - add_to_funcs(regexp_void, MWHEREIS|MREPLACE, + add_to_funcs(regexp_void, MWHEREIS|MREPLACE|MWHEREISFILE, N_("Regexp"), IFSCHELP(nano_regexp_msg), FALSE, VIEW); #endif #ifndef NANO_TINY - add_to_funcs(backwards_void, MWHEREIS|MREPLACE, + add_to_funcs(backwards_void, MWHEREIS|MREPLACE|MWHEREISFILE, N_("Backwards"), IFSCHELP(nano_reverse_msg), FALSE, VIEW); #endif @@ -1117,10 +1117,10 @@ void shortcut_init(void) add_to_sclist(((MMOST & ~MMAIN & ~MBROWSER) | MYESNO), "^C", do_cancel, 0); #ifndef NANO_TINY - add_to_sclist(MWHEREIS|MREPLACE, "M-B", backwards_void, 0); - add_to_sclist(MWHEREIS|MREPLACE, "M-C", case_sens_void, 0); + add_to_sclist(MWHEREIS|MREPLACE|MWHEREISFILE, "M-B", backwards_void, 0); + add_to_sclist(MWHEREIS|MREPLACE|MWHEREISFILE, "M-C", case_sens_void, 0); #endif - add_to_sclist(MWHEREIS|MREPLACE, "M-R", regexp_void, 0); + add_to_sclist(MWHEREIS|MREPLACE|MWHEREISFILE, "M-R", regexp_void, 0); add_to_sclist(MWHEREIS|MREPLACE, "^R", flip_replace_void, 0); add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE, "^Y", do_first_line, 0); add_to_sclist(MWHEREIS|MREPLACE|MREPLACEWITH|MGOTOLINE, "^V", do_last_line, 0); -- 2.39.5