commit 78d284881cba318ec81c05ba96cf85b1a1401f19
parent a36b726bdecf898d4a390367ef72a0e049c49a87
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Mon, 15 Aug 2022 11:45:15 +0200
help: don't show the New-Buffer toggle when in view mode
Since commit 63f2be7a from four years ago, view mode always sets
multibuffer mode, allowing ^R (Insert) to be invoked. But the
user is then not allowed to switch multibuffer mode off, so...
don't show the toggle.
Diffstat:
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/src/global.c b/src/global.c
@@ -1055,8 +1055,8 @@ void shortcut_init(void)
N_("Save"), WITHORSANS(savefile_gist), BLANKAFTER, NOVIEW);
#ifdef ENABLE_MULTIBUFFER
- /* Multiple buffers are only available when not in restricted mode. */
- if (!ISSET(RESTRICTED))
+ /* Include the new-buffer toggle only when it can actually be used. */
+ if (!ISSET(RESTRICTED) && !ISSET(VIEW_MODE))
add_to_funcs(flip_newbuffer, MINSERTFILE|MEXECUTE,
N_("New Buffer"), WITHORSANS(newbuffer_gist), TOGETHER, NOVIEW);
#endif
@@ -1459,8 +1459,7 @@ void shortcut_init(void)
add_to_sclist(MINSERTFILE, "M-N", 0, flip_convert, 0);
#endif
#ifdef ENABLE_MULTIBUFFER
- /* Only when not in restricted mode, allow multiple buffers. */
- if (!ISSET(RESTRICTED)) {
+ if (!ISSET(RESTRICTED) && !ISSET(VIEW_MODE)) {
add_to_sclist(MINSERTFILE|MEXECUTE, "M-F", 0, flip_newbuffer, 0);
#ifndef NANO_TINY
add_to_sclist(MEXECUTE, "M-\\", 0, flip_pipe, 0);