nano-devel
[Top][All Lists]
Advanced

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

[Nano-devel] [PATCH] options: let view mode activate "multibuffer" to al


From: Benno Schulenberg
Subject: [Nano-devel] [PATCH] options: let view mode activate "multibuffer" to allow viewing more files
Date: Mon, 15 Oct 2018 17:14:13 +0200

When --view is used without --ignorercfiles, the user could view
other files anyway if they had 'set multibuffer' in their nanorc.
So, just make this the default when --view is used, also because
"multibuffer" cannot be toggled once nano is running in view mode.

When the viewing of other files in view mode should not be allowed,
one should now additionally use --restricted.
---
 src/files.c | 4 ----
 src/nano.c  | 2 ++
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/files.c b/src/files.c
index 37581863..5878ff00 100644
--- a/src/files.c
+++ b/src/files.c
@@ -1258,10 +1258,6 @@ void do_insertfile_void(void)
 {
        if (ISSET(RESTRICTED))
                show_restricted_warning();
-#ifdef ENABLE_MULTIBUFFER
-       else if (ISSET(VIEW_MODE) && !ISSET(MULTIBUFFER))
-               statusbar(_("Key invalid in non-multibuffer mode"));
-#endif
        else
                do_insertfile();
 }
diff --git a/src/nano.c b/src/nano.c
index 31fd4ba3..c53bf9e0 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -2653,6 +2653,8 @@ int main(int argc, char **argv)
                openfile = openfile->next;
                if (more_than_one)
                        mention_name_and_linecount();
+               if (ISSET(VIEW_MODE))
+                       SET(MULTIBUFFER);
        }
 #endif
 
-- 
2.19.1




reply via email to

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