diff options
author | Vincent Labrecque <vincent@cvs.openbsd.org> | 2004-02-02 20:21:15 +0000 |
---|---|---|
committer | Vincent Labrecque <vincent@cvs.openbsd.org> | 2004-02-02 20:21:15 +0000 |
commit | 86e09e74e8b6b893701b2d25abbde8e67a37800e (patch) | |
tree | e332945088a966aea39386fa1fcee13bc50a230d /usr.bin/mg/main.c | |
parent | 3dac03178d6ec8da82bbf190c434a6a2cbfeae41 (diff) |
be just like gnu emacs when more than 2 files are specified on the command
line: create a buffer list window
Diffstat (limited to 'usr.bin/mg/main.c')
-rw-r--r-- | usr.bin/mg/main.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/mg/main.c b/usr.bin/mg/main.c index 7757426c48d..2a189b85f2b 100644 --- a/usr.bin/mg/main.c +++ b/usr.bin/mg/main.c @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.28 2004/01/27 23:43:37 vincent Exp $ */ +/* $OpenBSD: main.c,v 1.29 2004/02/02 20:21:14 vincent Exp $ */ /* * Mainline. @@ -19,7 +19,7 @@ int lastflag; /* flags, last command */ int curgoal; /* goal column */ int startrow; /* row to start */ BUFFER *curbp; /* current buffer */ -BUFFER *bheadp; /* BUFFER listhead */ +BUFFER *bheadp; /* BUFFER list head */ MGWIN *curwp; /* current window */ MGWIN *wheadp; /* MGWIN listhead */ char pat[NPAT]; /* pattern */ @@ -105,8 +105,9 @@ main(int argc, char **argv) notnum: cp = adjustname(argv[i]); if (cp != NULL) { - if (nfiles > 0 && nfiles < 3) + if (nfiles == 1) { splitwind(0, 1); + } curbp = findbuffer(cp); (void)showbuffer(curbp, curwp, 0); (void)readin(cp); @@ -117,6 +118,9 @@ notnum: } } + if (nfiles > 2) + listbuffers(0, 1); + /* fake last flags */ thisflag = 0; for (;;) { |