fix #ifdefs
git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3679 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
Этот коммит содержится в:
родитель
5c8d316a27
Коммит
1df1c9e4c0
11
src/nano.c
11
src/nano.c
@ -1256,15 +1256,18 @@ 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)
|
||||||
{
|
{
|
||||||
static struct termios newterm;
|
#ifdef USE_SLANG
|
||||||
static bool newterm_set = FALSE;
|
|
||||||
|
|
||||||
/* Slang curses emulation brain damage, part 2: Slang doesn't
|
/* Slang curses emulation brain damage, part 2: Slang doesn't
|
||||||
* implement nonl() or noecho() properly, so there's no way to
|
* implement nonl() or noecho() properly, so there's no way to
|
||||||
* properly reinitialize the terminal using them. We have to save
|
* properly reinitialize the terminal using them. We have to save
|
||||||
* the terminal state after the first call and restore it on
|
* the terminal state after the first call and restore it on
|
||||||
* subsequent calls. */
|
* subsequent calls. */
|
||||||
|
static struct termios newterm;
|
||||||
|
static bool newterm_set = FALSE;
|
||||||
|
|
||||||
if (!newterm_set) {
|
if (!newterm_set) {
|
||||||
|
#endif
|
||||||
|
|
||||||
cbreak();
|
cbreak();
|
||||||
nonl();
|
nonl();
|
||||||
noecho();
|
noecho();
|
||||||
@ -1273,10 +1276,12 @@ void terminal_init(void)
|
|||||||
if (!ISSET(PRESERVE))
|
if (!ISSET(PRESERVE))
|
||||||
disable_flow_control();
|
disable_flow_control();
|
||||||
|
|
||||||
|
#ifdef USE_SLANG
|
||||||
tcgetattr(0, &newterm);
|
tcgetattr(0, &newterm);
|
||||||
newterm_set = TRUE;
|
newterm_set = TRUE;
|
||||||
} else
|
} else
|
||||||
tcsetattr(0, TCSANOW, &newterm);
|
tcsetattr(0, TCSANOW, &newterm);
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Read in a character, interpret it as a shortcut or toggle if
|
/* Read in a character, interpret it as a shortcut or toggle if
|
||||||
|
Загрузка…
Ссылка в новой задаче
Block a user