From e1e6c5f612da9db23fe52d2fbd4dfe543a88b8e3 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 18 Oct 2017 20:40:13 +0200 Subject: [PATCH] bindings: make the search function rebindable again in help and browser Adjust to the changed meaning of 'whereis': it is no longer do_search() but do_search_forward(). Hinted-at-by: Brand Huntsman --- src/browser.c | 4 ++-- src/global.c | 10 ++++------ src/help.c | 4 ++-- 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/src/browser.c b/src/browser.c index 3c978bce..ac18b120 100644 --- a/src/browser.c +++ b/src/browser.c @@ -165,7 +165,7 @@ char *do_browser(char *path) #else say_there_is_no_help(); #endif - } else if (func == do_search) { + } else if (func == do_search_forward) { do_filesearch(); } else if (func == do_research) { do_fileresearch(TRUE); @@ -485,7 +485,7 @@ functionptrtype parse_browser_input(int *kbinput) case 'W': case 'w': case '/': - return do_search; + return do_search_forward; case 'N': #ifndef NANO_TINY return do_findprevious; diff --git a/src/global.c b/src/global.c index 13a138dd..3f301412 100644 --- a/src/global.c +++ b/src/global.c @@ -738,7 +738,7 @@ void shortcut_init(void) replace_tag, IFSCHELP(nano_replace_msg), TOGETHER, NOVIEW); #ifdef ENABLE_BROWSER - add_to_funcs(do_search, MBROWSER, + add_to_funcs(do_search_forward, MBROWSER, whereis_tag, IFSCHELP(nano_browser_whereis_msg), TOGETHER, VIEW); add_to_funcs(do_research, MBROWSER, @@ -757,7 +757,7 @@ void shortcut_init(void) add_to_funcs(total_refresh, MHELP, refresh_tag, "x", 0, VIEW); add_to_funcs(do_exit, MHELP, close_tag, "x", 0, VIEW); - add_to_funcs(do_search, MHELP, whereis_tag, "x", 0, VIEW); + add_to_funcs(do_search_forward, MHELP, whereis_tag, "x", 0, VIEW); add_to_funcs(do_research, MHELP, whereis_next_tag, "x", 0, VIEW); #endif @@ -1093,8 +1093,8 @@ void shortcut_init(void) add_to_sclist(MMAIN, "F5", 0, do_insertfile_void, 0); add_to_sclist(MMAIN, "Ins", 0, do_insertfile_void, 0); add_to_sclist(MMAIN, "^Q", 0, do_search_backward, 0); - add_to_sclist(MMAIN, "^W", 0, do_search_forward, 0); - add_to_sclist(MMAIN, "F6", 0, do_search_forward, 0); + add_to_sclist(MMAIN|MHELP|MBROWSER, "^W", 0, do_search_forward, 0); + add_to_sclist(MMAIN|MHELP|MBROWSER, "F6", 0, do_search_forward, 0); add_to_sclist(MMAIN, "^\\", 0, do_replace, 0); add_to_sclist(MMAIN, "M-R", 0, do_replace, 0); add_to_sclist(MMAIN, "F14", 0, do_replace, 0); @@ -1133,8 +1133,6 @@ void shortcut_init(void) add_to_sclist(MMAIN|MHELP, "M-/", 0, do_last_line, 0); add_to_sclist(MMAIN|MHELP, "^End", CONTROL_END, do_last_line, 0); add_to_sclist(MMAIN|MHELP, "M-?", 0, do_last_line, 0); - add_to_sclist(MHELP|MBROWSER, "^W", 0, do_search, 0); - add_to_sclist(MHELP|MBROWSER, "F6", 0, do_search, 0); add_to_sclist(MMAIN|MHELP|MBROWSER, "M-W", 0, do_research, 0); add_to_sclist(MMAIN|MHELP|MBROWSER, "F16", 0, do_research, 0); #ifndef NANO_TINY diff --git a/src/help.c b/src/help.c index 35a5c8b0..257c7ff1 100644 --- a/src/help.c +++ b/src/help.c @@ -205,7 +205,7 @@ void do_help(void) do_first_line(); } else if (func == do_last_line) { do_last_line(); - } else if (func == do_search) { + } else if (func == do_search_forward) { do_search(); bottombars(MHELP); } else if (func == do_research) { @@ -575,7 +575,7 @@ functionptrtype parse_help_input(int *kbinput) case 'W': case 'w': case '/': - return do_search; + return do_search_forward; case 'N': #ifndef NANO_TINY return do_findprevious;