Commit e21e9547 authored by Benno Schulenberg's avatar Benno Schulenberg
Browse files

browser: add a binding for the refresh function

And make the function actually refresh the list.  Useful for when files
have been added or deleted since opening the browser.
parent e2556274
Showing with 9 additions and 2 deletions
+9 -2
...@@ -174,6 +174,8 @@ char *do_browser(char *path, DIR *dir) ...@@ -174,6 +174,8 @@ char *do_browser(char *path, DIR *dir)
if (func == total_refresh) { if (func == total_refresh) {
total_redraw(); total_redraw();
/* Simulate a window resize. */
kbinput = KEY_WINCH;
} else if (func == do_help_void) { } else if (func == do_help_void) {
#ifndef DISABLE_HELP #ifndef DISABLE_HELP
do_help_void(); do_help_void();
......
...@@ -527,8 +527,8 @@ void shortcut_init(void) ...@@ -527,8 +527,8 @@ void shortcut_init(void)
const char *nano_whereis_msg = const char *nano_whereis_msg =
N_("Search for a string or a regular expression"); N_("Search for a string or a regular expression");
#ifndef DISABLE_BROWSER #ifndef DISABLE_BROWSER
const char *nano_browser_whereis_msg = const char *nano_browser_whereis_msg = N_("Search for a string");
N_("Search for a string"); const char *nano_browser_refresh_msg = N_("Refresh the file list");
#endif #endif
const char *nano_prevpage_msg = N_("Go one screenful up"); const char *nano_prevpage_msg = N_("Go one screenful up");
const char *nano_nextpage_msg = N_("Go one screenful down"); const char *nano_nextpage_msg = N_("Go one screenful down");
...@@ -1013,6 +1013,10 @@ void shortcut_init(void) ...@@ -1013,6 +1013,10 @@ void shortcut_init(void)
add_to_funcs(do_research, MBROWSER, add_to_funcs(do_research, MBROWSER,
whereis_next_tag, IFSCHELP(nano_whereis_next_msg), TOGETHER, VIEW); whereis_next_tag, IFSCHELP(nano_whereis_next_msg), TOGETHER, VIEW);
#endif #endif
#ifndef DISABLE_BROWSER
add_to_funcs(total_refresh, MBROWSER,
refresh_tag, IFSCHELP(nano_browser_refresh_msg), BLANKAFTER, VIEW);
#endif
#ifndef DISABLE_COLOR #ifndef DISABLE_COLOR
add_to_funcs(do_page_up, MLINTER, add_to_funcs(do_page_up, MLINTER,
...@@ -1199,6 +1203,7 @@ void shortcut_init(void) ...@@ -1199,6 +1203,7 @@ void shortcut_init(void)
add_to_sclist(MBROWSER, "^_", goto_dir_void, 0); add_to_sclist(MBROWSER, "^_", goto_dir_void, 0);
add_to_sclist(MBROWSER, "M-G", goto_dir_void, 0); add_to_sclist(MBROWSER, "M-G", goto_dir_void, 0);
add_to_sclist(MBROWSER, "F13", goto_dir_void, 0); add_to_sclist(MBROWSER, "F13", goto_dir_void, 0);
add_to_sclist(MBROWSER, "^L", total_refresh, 0);
#endif #endif
if (ISSET(TEMP_FILE)) if (ISSET(TEMP_FILE))
add_to_sclist(MWRITEFILE, "^Q", discard_buffer, 0); add_to_sclist(MWRITEFILE, "^Q", discard_buffer, 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment