1
0
mirror of https://github.com/rfivet/uemacs.git synced 2024-06-10 14:00:41 +00:00

Handle DEL consistently in display and input.

This commit is contained in:
Renaud 2019-08-08 10:55:17 +08:00
parent 3e12643077
commit 08b75d677e
2 changed files with 4 additions and 9 deletions

View File

@ -217,18 +217,12 @@ static void vtputc(int c)
return ; return ;
} }
if (c < 0x20) { if (c < 0x20 || c == 0x7F) {
vtputc('^'); vtputc('^');
vtputc(c ^ 0x40); vtputc(c ^ 0x40);
return; return;
} }
if (c == 0x7f) {
vtputc('^');
vtputc('?');
return;
}
if (c >= 0x80 && c <= 0xA0) { if (c >= 0x80 && c <= 0xA0) {
static const char hex[] = "0123456789abcdef"; static const char hex[] = "0123456789abcdef";
vtputc('\\'); vtputc('\\');

View File

@ -509,7 +509,7 @@ static void echov( int c) {
if( c == '\n') /* put out <NL> for <ret> */ if( c == '\n') /* put out <NL> for <ret> */
echos( "<NL>") ; echos( "<NL>") ;
else { else {
if( c < ' ') { if( c < ' ' || c == 0x7F) {
echoc( '^') ; echoc( '^') ;
c ^= 0x40 ; c ^= 0x40 ;
} }
@ -520,7 +520,8 @@ static void echov( int c) {
static void rubc( char c) { static void rubc( char c) {
rubout() ; rubout() ;
if( c < ' ') { if( c < ' ' || c == 0x7F) {
/* ^x range */
rubout() ; rubout() ;
if( c == '\n') { if( c == '\n') {
rubout() ; rubout() ;