Commit 1d43db87 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

if multibuffer support is compiled in, properly read in multiple files

at the command line even if multibuffer mode isn't turned on


git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1740 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 97133f59
Showing with 13 additions and 1 deletion
+13 -1
......@@ -65,6 +65,14 @@ CVS code -
- 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)
......
......@@ -3520,7 +3520,9 @@ int main(int argc, char *argv[])
/* 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();
......@@ -3529,6 +3531,8 @@ int main(int argc, char *argv[])
load_file(0);
}
open_nextfile_void();
if (!old_multibuffer)
UNSET(MULTIBUFFER);
}
#endif
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment