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-d3aeb78583b8master
parent
3ce7e9dcac
commit
b5e66d05cb
|
@ -150,7 +150,7 @@ CVS code -
|
|||
(Benno Schulenberg, minor tweaks by DLR and Nick Warne)
|
||||
- Make suspension clear the screen and put the cursor on the
|
||||
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:
|
||||
do_browser()
|
||||
- Reference NANO_GOTODIR_(ALT|F)?KEY instead of
|
||||
|
|
34
src/nano.c
34
src/nano.c
|
@ -1027,7 +1027,11 @@ RETSIGTYPE do_continue(int signal)
|
|||
/* Restore the terminal to its previous state. */
|
||||
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();
|
||||
#endif
|
||||
}
|
||||
|
@ -1228,13 +1232,27 @@ void enable_flow_control(void)
|
|||
* interpretation of the flow control characters too. */
|
||||
void terminal_init(void)
|
||||
{
|
||||
cbreak();
|
||||
nonl();
|
||||
noecho();
|
||||
disable_extended_io();
|
||||
disable_signals();
|
||||
if (!ISSET(PRESERVE))
|
||||
disable_flow_control();
|
||||
static struct termios newterm;
|
||||
static bool newterm_set = FALSE;
|
||||
|
||||
/* Slang curses emulation brain damage, part 2: Slang doesn't
|
||||
* implement some of these curses calls properly, so there's no way
|
||||
* to properly reinitialize the terminal using them. We have to
|
||||
* 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
|
||||
|
|
|
@ -64,7 +64,7 @@
|
|||
#ifdef USE_SLANG
|
||||
/* Slang support. */
|
||||
#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. */
|
||||
#define KEY_DC SL_KEY_DELETE
|
||||
#define KEY_IC SL_KEY_IC
|
||||
|
|
|
@ -2976,7 +2976,7 @@ void edit_update(update_type location)
|
|||
void total_redraw(void)
|
||||
{
|
||||
#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. */
|
||||
SLsmg_touch_screen();
|
||||
SLsmg_refresh();
|
||||
|
|
Loading…
Reference in New Issue