- Don't open the first file in quiet mode, since if we do, an
error message won't be shown if it's unreadable. (DLR; found
by Jaap Eldering)
+ - If we've specified multiple files on the command line and
+ multibuffer support is compiled in, turn multibuffer mode on
+ when reading those files and turn it off afterward if it was
+ off before. This allows us to open multiple files without
+ having to turn multibuffer mode on at the command line or in
+ the nanorc first, both of which are unintuitive. Multibuffer
+ mode should only affect how the "Read File" command behaves
+ anyway. (DLR)
- nano.h:
- Since REGEXP_COMPILED is only used in search.c, convert it
from a flag to a static int there. (DLR)
/* If we're using multibuffers and more than one file is specified
on the command line, load them all and switch to the first one
afterward */
- if (ISSET(MULTIBUFFER) && optind + 1 < argc) {
+ if (optind + 1 < argc) {
+ int old_multibuffer = ISSET(MULTIBUFFER);
+ SET(MULTIBUFFER);
for (optind++; optind < argc; optind++) {
add_open_file(1);
new_file();
load_file(0);
}
open_nextfile_void();
+ if (!old_multibuffer)
+ UNSET(MULTIBUFFER);
}
#endif