Commit b5e66d05 authored by David Lawrence Ramsey's avatar David Lawrence Ramsey
Browse files

make the changed suspend/continue routines work properly under slang

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3650 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
parent 3ce7e9dc
Showing with 29 additions and 11 deletions
+29 -11
...@@ -150,7 +150,7 @@ CVS code - ...@@ -150,7 +150,7 @@ CVS code -
(Benno Schulenberg, minor tweaks by DLR and Nick Warne) (Benno Schulenberg, minor tweaks by DLR and Nick Warne)
- Make suspension clear the screen and put the cursor on the - Make suspension clear the screen and put the cursor on the
last line before displaying anything, as Pico does. Changes last line before displaying anything, as Pico does. Changes
to do_suspend() and do_continue(). (DLR) to do_suspend(), do_continue(), and terminal_init(). (DLR)
- browser.c: - browser.c:
do_browser() do_browser()
- Reference NANO_GOTODIR_(ALT|F)?KEY instead of - Reference NANO_GOTODIR_(ALT|F)?KEY instead of
......
...@@ -1027,7 +1027,11 @@ RETSIGTYPE do_continue(int signal) ...@@ -1027,7 +1027,11 @@ RETSIGTYPE do_continue(int signal)
/* Restore the terminal to its previous state. */ /* Restore the terminal to its previous state. */
terminal_init(); terminal_init();
/* Update the screen. */ /* Turn the cursor back on for sure. */
curs_set(1);
/* Redraw the contents of the windows that need it. */
blank_statusbar();
total_refresh(); total_refresh();
#endif #endif
} }
...@@ -1228,13 +1232,27 @@ void enable_flow_control(void) ...@@ -1228,13 +1232,27 @@ void enable_flow_control(void)
* interpretation of the flow control characters too. */ * interpretation of the flow control characters too. */
void terminal_init(void) void terminal_init(void)
{ {
cbreak(); static struct termios newterm;
nonl(); static bool newterm_set = FALSE;
noecho();
disable_extended_io(); /* Slang curses emulation brain damage, part 2: Slang doesn't
disable_signals(); * implement some of these curses calls properly, so there's no way
if (!ISSET(PRESERVE)) * to properly reinitialize the terminal using them. We have to
disable_flow_control(); * save the termios state on the first call and restore it on
* subsequent calls. */
if (!newterm_set) {
cbreak();
nonl();
noecho();
disable_extended_io();
disable_signals();
if (!ISSET(PRESERVE))
disable_flow_control();
tcgetattr(0, &newterm);
newterm_set = TRUE;
} else
tcsetattr(0, TCSANOW, &newterm);
} }
/* Read in a character, interpret it as a shortcut or toggle if /* Read in a character, interpret it as a shortcut or toggle if
......
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
#ifdef USE_SLANG #ifdef USE_SLANG
/* Slang support. */ /* Slang support. */
#include <slcurses.h> #include <slcurses.h>
/* Slang curses emulation brain damage, part 2: Slang doesn't define the /* Slang curses emulation brain damage, part 3: Slang doesn't define the
* curses equivalents of the Insert or Delete keys. */ * curses equivalents of the Insert or Delete keys. */
#define KEY_DC SL_KEY_DELETE #define KEY_DC SL_KEY_DELETE
#define KEY_IC SL_KEY_IC #define KEY_IC SL_KEY_IC
......
...@@ -2976,7 +2976,7 @@ void edit_update(update_type location) ...@@ -2976,7 +2976,7 @@ void edit_update(update_type location)
void total_redraw(void) void total_redraw(void)
{ {
#ifdef USE_SLANG #ifdef USE_SLANG
/* Slang curses emulation brain damage, part 3: Slang doesn't define /* Slang curses emulation brain damage, part 4: Slang doesn't define
* curscr. */ * curscr. */
SLsmg_touch_screen(); SLsmg_touch_screen();
SLsmg_refresh(); SLsmg_refresh();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment