diff options
author | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-16 17:22:58 +0100 |
---|---|---|
committer | Robin Haberkorn <robin.haberkorn@googlemail.com> | 2015-03-16 17:22:58 +0100 |
commit | 2a4acd6b619c4e52bf65b23bbbaef0cc8a0c6361 (patch) | |
tree | 215d58ae23b3a2a070a00ed8017517909ab597a3 /src/interface-curses.cpp | |
parent | dd45a599ad9fd7765c9664877f21e018fa56c8a0 (diff) | |
download | sciteco-2a4acd6b619c4e52bf65b23bbbaef0cc8a0c6361.tar.gz |
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
Diffstat (limited to 'src/interface-curses.cpp')
-rw-r--r-- | src/interface-curses.cpp | 15 |
1 files 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(); |