From 63f2be7a2f70fd967e043149d1bf1eeeeb1bd175 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Fri, 12 Oct 2018 19:57:43 +0200 Subject: [PATCH] options: let view mode activate "multibuffer" to allow viewing more files 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 2d0458ce..8c42eaa9 100644 --- a/src/nano.c +++ b/src/nano.c @@ -2654,6 +2654,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