commit ea5e199d3b7bcb323c35fbcfb795af539e8e65f7
parent e7c28bcb66945868ea71c58e9f30fb0be259181a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Thu, 10 Jul 2025 09:57:38 +0200
browser: let a refresh also reread the file list, like it used to
Until two commits ago, a full refresh (^L) would first refresh the
screen and then reread the file list and redo the screen again.
Now it will just reread the list and redo the screen, skipping the
redundant refresh. The latter is done only for the tiny version.
Also rename a label, to be more precise.
Diffstat:
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/src/browser.c b/src/browser.c
@@ -490,9 +490,13 @@ char *browse(char *path)
function = interpret(kbinput);
- if (function == do_help || function == full_refresh) {
- function();
-#ifndef NANO_TINY
+ if (function == do_help)
+ do_help();
+ else if (function == full_refresh) {
+#ifdef NANO_TINY
+ full_refresh();
+#else
+ kbinput = THE_WINDOW_RESIZED;
} else if (function == do_toggle && get_shortcut(kbinput)->toggle == NO_HELP) {
TOGGLE(NO_HELP);
window_init();
@@ -557,7 +561,7 @@ char *browse(char *path)
/* TRANSLATORS: This is a prompt. */
browser_refresh, _("Go To Directory")) < 0) {
statusbar(_("Cancelled"));
- goto rearrange;
+ goto testresize;
}
path = free_and_assign(path, real_dir_from_tilde(answer));
@@ -574,7 +578,7 @@ char *browse(char *path)
* the option --operatingdir, not of --restricted. */
statusline(ALERT, _("Can't go outside of %s"), operating_dir);
path = mallocstrcpy(path, present_path);
- goto rearrange;
+ goto testresize;
}
#endif
/* Snip any trailing slashes, so the name can be compared. */
@@ -645,7 +649,7 @@ char *browse(char *path)
} else
unbound_key(kbinput);
- rearrange:
+ testresize:
#ifndef NANO_TINY
/* If the terminal resized (or might have), refresh the file list. */
if (kbinput == THE_WINDOW_RESIZED || resized_for_browser) {