mirror of
https://github.com/troglobit/editline.git
synced 2025-05-06 12:31:45 +08:00
readline(): Check common signals first.
Make sure to check common signals first to prevent other interpretations. Signed-off-by: Joachim Nilsson <troglobit@gmail.com>
This commit is contained in:
parent
088dc1d1b2
commit
8e81add050
@ -901,21 +901,6 @@ static el_status_t emacs(int c)
|
|||||||
|
|
||||||
static el_status_t tty_special(int c)
|
static el_status_t tty_special(int c)
|
||||||
{
|
{
|
||||||
if (rl_meta_chars && ISMETA(c))
|
|
||||||
return CSdispatch;
|
|
||||||
|
|
||||||
if (c == rl_erase || c == DEL)
|
|
||||||
return bk_del_char();
|
|
||||||
if (c == rl_kill) {
|
|
||||||
if (rl_point != 0) {
|
|
||||||
rl_point = 0;
|
|
||||||
reposition();
|
|
||||||
}
|
|
||||||
Repeat = NO_ARG;
|
|
||||||
return kill_line();
|
|
||||||
}
|
|
||||||
if (c == rl_eof && rl_point == 0 && rl_end == 0)
|
|
||||||
return CSeof;
|
|
||||||
if (c == rl_intr) {
|
if (c == rl_intr) {
|
||||||
el_intr_pending = SIGINT;
|
el_intr_pending = SIGINT;
|
||||||
return CSsignal;
|
return CSsignal;
|
||||||
@ -931,6 +916,23 @@ static el_status_t tty_special(int c)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
if (rl_meta_chars && ISMETA(c))
|
||||||
|
return CSdispatch;
|
||||||
|
|
||||||
|
if (c == rl_erase || c == DEL)
|
||||||
|
return bk_del_char();
|
||||||
|
if (c == rl_kill) {
|
||||||
|
if (rl_point != 0) {
|
||||||
|
rl_point = 0;
|
||||||
|
reposition();
|
||||||
|
}
|
||||||
|
Repeat = NO_ARG;
|
||||||
|
return kill_line();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (c == rl_eof && rl_point == 0 && rl_end == 0)
|
||||||
|
return CSeof;
|
||||||
|
|
||||||
return CSdispatch;
|
return CSdispatch;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user