aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/term.c
diff options
context:
space:
mode:
authorScott Prager <splinterofchaos@gmail.com>2014-09-17 19:17:22 -0400
committerScott Prager <splinterofchaos@gmail.com>2014-11-28 14:27:16 -0500
commit8d271bb57bdf6e7718da91f58f98cf0da0fe0e71 (patch)
tree6da5e19a49e8531a5580e810bdd05be2097b9068 /src/nvim/term.c
parenta3ef5723a95edf153095f512417c402202ac3270 (diff)
downloadrneovim-8d271bb57bdf6e7718da91f58f98cf0da0fe0e71.tar.gz
rneovim-8d271bb57bdf6e7718da91f58f98cf0da0fe0e71.tar.bz2
rneovim-8d271bb57bdf6e7718da91f58f98cf0da0fe0e71.zip
mch_init -> term_init
Diffstat (limited to 'src/nvim/term.c')
-rw-r--r--src/nvim/term.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/nvim/term.c b/src/nvim/term.c
index 18620ea766..fd2988c850 100644
--- a/src/nvim/term.c
+++ b/src/nvim/term.c
@@ -1010,6 +1010,30 @@ static struct builtin_term builtin_termcaps[] =
# define DEFAULT_TERM (char_u *)"dumb"
#endif
+/// Sets up the terminal window for use.
+///
+/// This must be done after resetting full_screen, otherwise it may move the
+/// cursor.
+///
+/// @remark We may call mch_exit() before calling this.
+void term_init(void)
+{
+ Columns = 80;
+ Rows = 24;
+
+ // Prevent buffering output.
+ // Output gets explicitly buffered and flushed by out_flush() at times like,
+ // for example, when the user presses a key. Without this line, vim will not
+ // render the screen correctly.
+ setbuf(stdout, NULL);
+
+ out_flush();
+
+#ifdef MACOS_CONVERT
+ mac_conv_init();
+#endif
+}
+
/*
* Term_strings contains currently used terminal output strings.
* It is initialized with the default values by parse_builtin_tcap().