nano-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] bindings: make Refresh (^L) work at all the prompts too


From: Benno Schulenberg
Subject: [PATCH] bindings: make Refresh (^L) work at all the prompts too
Date: Mon, 1 Jun 2020 10:12:14 +0200

Unfortunately, this means that ^L cannot be used for the Linter in
the "Execute Command" menu.

Unfortunately, it also means that Refresh cannot be rebound at the
prompts -- because I do not want to list ^L in each and every help
text.  At the prompts, only ^L will work, and if ^L is bound to
something else, Refresh will be unavailable.  It's not a big deal,
because no one ever complained that ^L didn't work at the prompts
any more, so there is no real demand for it.  But it is nice that
it works at least in the default setup.

This fixes https://savannah.gnu.org/bugs/?58469.

Bug existed since around version 2.1.0.
---
 src/global.c |  6 +++---
 src/prompt.c | 11 ++++-------
 2 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/src/global.c b/src/global.c
index 6edeacde..86fb791a 100644
--- a/src/global.c
+++ b/src/global.c
@@ -1190,7 +1190,7 @@ void shortcut_init(void)
 #endif
 #ifdef ENABLE_COLOR
        add_to_sclist(MMAIN, "M-B", 0, do_linter, 0);
-       add_to_sclist(MEXECUTE, "^L", 0, do_linter, 0);
+       add_to_sclist(MEXECUTE, "^Y", 0, do_linter, 0);
        add_to_sclist(MMAIN, "M-F", 0, do_formatter, 0);
        add_to_sclist(MEXECUTE, "^O", 0, do_formatter, 0);
 #endif
@@ -1336,9 +1336,9 @@ void shortcut_init(void)
        add_to_sclist(MEXECUTE, "^J", 0, do_full_justify, 0);
 #endif
        if (!ISSET(PRESERVE))
-               add_to_sclist(MMAIN|MBROWSER|MHELP, "^L", 0, full_refresh, 0);
+               add_to_sclist(MMOST|MBROWSER|MHELP|MYESNO, "^L", 0, 
full_refresh, 0);
        else
-               add_to_sclist(MMAIN|MBROWSER, "^L", 0, full_refresh, 0);
+               add_to_sclist(MMOST|MBROWSER|MYESNO, "^L", 0, full_refresh, 0);
        add_to_sclist(MMAIN|MEXECUTE, "^Z", 0, do_suspend_void, 0);
 
 #ifndef NANO_TINY
diff --git a/src/prompt.c b/src/prompt.c
index f66da1c8..7d6329d4 100644
--- a/src/prompt.c
+++ b/src/prompt.c
@@ -509,14 +509,9 @@ functionptrtype acquire_an_answer(int *actual, bool 
allow_tabs,
                        }
                } else
 #endif /* ENABLE_HISTORIES */
-               if (func == do_help) {
-                       /* This key has a shortcut-list entry when it's used to 
go to
-                        * the help viewer or display a message indicating that 
help
-                        * is disabled, which means that finished has been set 
to TRUE.
-                        * Set it back to FALSE here, so that we aren't kicked 
out of
-                        * the status-bar prompt. */
+               /* If we ran a function that should not exit from the prompt... 
*/
+               if (func == do_help || func == full_refresh)
                        finished = FALSE;
-               }
 #ifndef NANO_TINY
                else if (func == do_nothing)
                        finished = FALSE;
@@ -744,6 +739,8 @@ int do_yesno_prompt(bool all, const char *msg)
                        }
                }
 #endif /* ENABLE_MOUSE */
+               else if (kbinput == 0x0C)
+                       full_refresh();
                else
                        beep();
 
-- 
2.25.4




reply via email to

[Prev in Thread] Current Thread [Next in Thread]