edit: Fix Home/End escape codes

This commit is contained in:
Jouni Malinen 2010-11-20 11:20:48 +02:00
parent ef49bb80a9
commit 73669f1b03

View file

@ -456,12 +456,6 @@ static void edit_read_char(int sock, void *eloop_ctx, void *sock_ctx)
case 'D': /* left */ case 'D': /* left */
move_left(); move_left();
break; break;
case 'F': /* end */
move_end();
break;
case 'H': /* home */
move_start();
break;
default: default:
printf("{ESC%s}[1]\n", esc_buf); printf("{ESC%s}[1]\n", esc_buf);
edit_redraw(); edit_redraw();
@ -533,6 +527,12 @@ static void edit_read_char(int sock, void *eloop_ctx, void *sock_ctx)
if (esc > 1 && esc_buf[0] == 'O') { if (esc > 1 && esc_buf[0] == 'O') {
switch (esc_buf[1]) { switch (esc_buf[1]) {
case 'F': /* end */
move_end();
break;
case 'H': /* home */
move_start();
break;
case 'P': /* F1 */ case 'P': /* F1 */
history_debug_dump(); history_debug_dump();
break; break;