From 12d307b5b43482a776c49098bf9e8d55638dd0b6 Mon Sep 17 00:00:00 2001 From: Renaud Fivet Date: Mon, 1 Apr 2024 11:17:19 +0800 Subject: [PATCH] Display non breaking space according to code page instead of \A0. --- basic.c | 2 +- display.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/basic.c b/basic.c index 791d021..e4ab684 100644 --- a/basic.c +++ b/basic.c @@ -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) ; diff --git a/display.c b/display.c index 4422f45..84f6908 100644 --- a/display.c +++ b/display.c @@ -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 */