=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/vim/Attic/main.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- src/usr.bin/vim/Attic/main.c 1996/09/22 01:18:02 1.3 +++ src/usr.bin/vim/Attic/main.c 1996/09/24 22:12:57 1.4 @@ -1,4 +1,4 @@ -/* $OpenBSD: main.c,v 1.3 1996/09/22 01:18:02 downsj Exp $ */ +/* $OpenBSD: main.c,v 1.4 1996/09/24 22:12:57 downsj Exp $ */ /* vi:set ts=4 sw=4: * * VIM - Vi IMproved by Bram Moolenaar @@ -154,6 +154,7 @@ int check_version = FALSE; /* check .vimrc version number */ int argv_idx; /* index in argv[n][] */ int invoked_as_ex = FALSE; /* argv[0] is "ex" */ + int term_inited = FALSE; #if defined(MSDOS) || defined(WIN32) || defined(OS2) static struct initmap @@ -475,16 +476,6 @@ } } - /* note that we may use mch_windexit() before mch_windinit()! */ - mch_windinit(); /* inits Rows and Columns */ -/* - * Set the default values for the options that use Rows and Columns. - */ - set_init_2(); - - firstwin->w_height = Rows - 1; - cmdline_row = Rows - 1; - /* * Process the other command line arguments. * -e[errorfile] quickfix mode @@ -548,6 +539,24 @@ } else /* must be a file name */ { + if (!term_inited) + { +#ifdef USE_GUI + if (!gui.starting) +#endif + termcapinit(term); + + /* note that we may use mch_windexit() before mch_windinit()! */ + mch_windinit(); /* inits Rows and Columns */ + /* + * Set the default values for the options that use Rows and + * Columns. + */ + set_init_2(); + + term_inited = TRUE; + } + /* * Skip a single "--" argument, used in front of a file name that * starts with '-'. @@ -577,7 +586,24 @@ } } } + if (!term_inited) + { +#ifdef USE_GUI + if (!gui.starting) +#endif + termcapinit(term); + /* note that we may use mch_windexit() before mch_windinit()! */ + mch_windinit(); /* inits Rows and Columns */ + /* + * Set the default values for the options that use Rows and + * Columns. + */ + set_init_2(); + + term_inited = TRUE; + } + RedrawingDisabled = TRUE; /* @@ -613,7 +639,7 @@ curbuf->b_nwindows = 1; /* there is one window */ win_init(curwin); /* init current window */ init_yank(); /* init yank buffers */ - if (full_screen) + if (full_screen && !term_inited) termcapinit(term); /* set terminal name and get terminal capabilities */ screenclear(); /* clear screen (just inits screen structures,