From 2a4acd6b619c4e52bf65b23bbbaef0cc8a0c6361 Mon Sep 17 00:00:00 2001 From: Robin Haberkorn Date: Mon, 16 Mar 2015 17:22:58 +0100 Subject: fixed curses prog-mode reinitialization when SciTECO interactive mode is started, the curses prog mode is restored automatically. Therefore it should already be set up correctly (after SciTECO batch mode initialization). This fixes console glitches on MinGW/PDCurses. partial revert of commit 4dced2 --- src/interface-curses.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/interface-curses.cpp b/src/interface-curses.cpp index eb44acb..0eba956 100644 --- a/src/interface-curses.cpp +++ b/src/interface-curses.cpp @@ -103,6 +103,17 @@ InterfaceCurses::main_impl(int &argc, char **&argv) { init_batch(); + /* + * We're in prog mode, so we must set it up + * now, even though we're also in SciTECO batch mode. + * This is because endwin() saves the prog mode + * and Curses restores it automatically. + */ + cbreak(); + noecho(); + /* Scintilla draws its own cursor */ + curs_set(0); + setlocale(LC_CTYPE, ""); /* for displaying UTF-8 characters properly */ info_window = newwin(1, 0, 0, 0); @@ -709,10 +720,6 @@ InterfaceCurses::event_loop_impl(void) */ init_interactive(); - cbreak(); - noecho(); - curs_set(0); /* Scintilla draws its own cursor */ - /* initial refresh */ /* FIXME: this does wrefresh() internally */ current_view->refresh(); -- cgit v1.2.3