tex: call term_init() before ex_init() - neatvi - [fork] simple vi-type editor with UTF-8 support (HTM) git clone git://src.adamsgaard.dk/neatvi (DIR) Log (DIR) Files (DIR) Refs (DIR) README --- (DIR) commit 1a71c8b9dd2cf614712d7ebdab0c8a8f0f624a22 (DIR) parent 733ab28c663f58da7672046120e7cb1745c8fe79 (HTM) Author: John Vogel <jvogel4@stny.rr.com> Date: Tue, 16 Jun 2015 08:32:27 +0430 ex: call term_init() before ex_init() Diffstat: M ex.c | 4 ---- M vi.c | 6 ++++-- 2 files changed, 4 insertions(+), 6 deletions(-) --- (DIR) diff --git a/ex.c b/ex.c t@@ -720,16 +720,12 @@ void ex_command(char *ln) /* ex main loop */ void ex(void) { - if (xled) - term_init(); while (!xquit) { char *ln = ex_read(":"); if (ln) ex_command(ln); free(ln); } - if (xled) - term_done(); } void ex_init(char **files) (DIR) diff --git a/vi.c b/vi.c t@@ -973,7 +973,6 @@ static void vi(void) int mark; char *ln; char *kmap = NULL; - term_init(); xtop = 0; xrow = 0; xoff = 0; t@@ -1221,7 +1220,6 @@ static void vi(void) } term_pos(xrows, 0); term_kill(); - term_done(); } int main(int argc, char *argv[]) t@@ -1238,11 +1236,15 @@ int main(int argc, char *argv[]) } dir_init(); syn_init(); + if (xled || xvis) + term_init(); ex_init(argv + i); if (xvis) vi(); else ex(); + if (xled || xvis) + term_done(); ex_done(); reg_done(); syn_done();