From 08b75d677e544c9e4449ea7e6a6631bc1a6ee384 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Thu, 8 Aug 2019 10:55:17 +0800 Subject: [PATCH] Handle DEL consistently in display and input. --- display.c | 8 +------- input.c | 5 +++-- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/display.c b/display.c index ce7600f..0863cbc 100644 --- a/display.c +++ b/display.c @@ -217,18 +217,12 @@ static void vtputc(int c) return ; } - if (c < 0x20) { + if (c < 0x20 || c == 0x7F) { vtputc('^'); vtputc(c ^ 0x40); return; } - if (c == 0x7f) { - vtputc('^'); - vtputc('?'); - return; - } - if (c >= 0x80 && c <= 0xA0) { static const char hex[] = "0123456789abcdef"; vtputc('\\'); diff --git a/input.c b/input.c index 677a13f..e9fa69e 100644 --- a/input.c +++ b/input.c @@ -509,7 +509,7 @@ static void echov( int c) { if( c == '\n') /* put out for */ echos( "") ; else { - if( c < ' ') { + if( c < ' ' || c == 0x7F) { echoc( '^') ; c ^= 0x40 ; } @@ -520,7 +520,8 @@ static void echov( int c) { static void rubc( char c) { rubout() ; - if( c < ' ') { + if( c < ' ' || c == 0x7F) { + /* ^x range */ rubout() ; if( c == '\n') { rubout() ;