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.
This commit is contained in:
Benno Schulenberg 2018-10-12 19:57:43 +02:00
parent 71de0b9e2f
commit 63f2be7a2f
2 changed files with 2 additions and 4 deletions

View File

@ -1258,10 +1258,6 @@ void do_insertfile_void(void)
{ {
if (ISSET(RESTRICTED)) if (ISSET(RESTRICTED))
show_restricted_warning(); show_restricted_warning();
#ifdef ENABLE_MULTIBUFFER
else if (ISSET(VIEW_MODE) && !ISSET(MULTIBUFFER))
statusbar(_("Key invalid in non-multibuffer mode"));
#endif
else else
do_insertfile(); do_insertfile();
} }

View File

@ -2654,6 +2654,8 @@ int main(int argc, char **argv)
openfile = openfile->next; openfile = openfile->next;
if (more_than_one) if (more_than_one)
mention_name_and_linecount(); mention_name_and_linecount();
if (ISSET(VIEW_MODE))
SET(MULTIBUFFER);
} }
#endif #endif