summaryrefslogtreecommitdiff
path: root/usr.bin/vim/main.c
diff options
context:
space:
mode:
authorJason Downs <downsj@cvs.openbsd.org>1996-09-24 22:12:58 +0000
committerJason Downs <downsj@cvs.openbsd.org>1996-09-24 22:12:58 +0000
commitad02d362872016f16d6399fd0036e47af18d4e0a (patch)
treea334ad4b5e4359732b7f67411af94177817e44c2 /usr.bin/vim/main.c
parent0d05fc84024b2403bfc41450939fd55c2cb67f45 (diff)
Ensure that termcap get's initializaed before window size.
Diffstat (limited to 'usr.bin/vim/main.c')
-rw-r--r--usr.bin/vim/main.c50
1 files changed, 38 insertions, 12 deletions
diff --git a/usr.bin/vim/main.c b/usr.bin/vim/main.c
index 53715b9ed9e..bf1b3c08665 100644
--- a/usr.bin/vim/main.c
+++ b/usr.bin/vim/main.c
@@ -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 @@ main(argc, argv)
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 @@ main(argc, argv)
}
}
- /* 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 @@ main(argc, argv)
}
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,6 +586,23 @@ main(argc, argv)
}
}
}
+ 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 @@ main(argc, argv)
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,