Display non breaking space according to code page instead of \A0.

This commit is contained in:
Renaud 2024-04-01 11:17:19 +08:00
parent 54145a48f8
commit 12d307b5b4
2 changed files with 3 additions and 3 deletions

View File

@ -42,7 +42,7 @@ static unsigned getgoal( line_p dlp) {
col += tabwidth - col % tabwidth ;
else if( c < 0x20 || c == 0x7F) /* ^x */
col += 2 ;
else if( c >= 0x80 && c <= 0xA0) /* \xx */
else if( c >= 0x80 && c < 0xA0) /* \xx */
col += 3 ;
else
col += utf8_width( c) ;

View File

@ -235,7 +235,7 @@ static void vtputuc( unicode_t c) {
} else if( c < 0x20 || c == 0x7F) {
sane_vtputc( '^') ;
sane_vtputc( c ^ 0x40) ;
} else if( c >= 0x80 && c <= 0xA0) {
} else if( c >= 0x80 && c < 0xA0) {
static const char hex[] = "0123456789abcdef" ;
sane_vtputc( '\\') ;
sane_vtputc( hex[ c >> 4]) ;
@ -556,7 +556,7 @@ static void updpos( void) {
curcol += tabwidth - curcol % tabwidth ;
else if( c < 0x20 || c == 0x7F)
curcol += 2 ; /* displayed as ^c */
else if( c >= 0x80 && c <= 0xA0)
else if( c >= 0x80 && c < 0xA0)
curcol += 3 ; /* displayed as \xx */
else
curcol += utf8_width( c) ; /* non printable are displayed as \u */