nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 63f2be7a2f70fd967e043149d1bf1eeeeb1bd175
parent 71de0b9e2fc2a88879248f70dbab0e4b3417adca
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Fri, 12 Oct 2018 19:57:43 +0200

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.

Diffstat:
Msrc/files.c | 4----
Msrc/nano.c | 2++
2 files changed, 2 insertions(+), 4 deletions(-)

diff --git 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 @@ -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