From: Benno Schulenberg Date: Tue, 1 Jul 2014 15:42:08 +0000 (+0000) Subject: Showing that it is possible to have case-sensitive, regular-expressive, X-Git-Tag: v2.3.5~13 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=4947ad83cb50ae3a6d9dc5a6c920c35109eb12bf;p=nano.git 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 --- 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);