From 28e3e6b259785e61eb6690970d1f3141739cefa6 Mon Sep 17 00:00:00 2001 From: Sergio Garcia Date: Mon, 9 Feb 2026 12:53:28 -0300 Subject: [PATCH] fix: use non graphic char for changed bytes in ASCII panel --- src/hex/draw.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/hex/draw.rs b/src/hex/draw.rs index 6785498..f5243ce 100644 --- a/src/hex/draw.rs +++ b/src/hex/draw.rs @@ -186,7 +186,12 @@ pub fn draw_hex_ascii(app: &mut App, frame: &mut Frame, area: Rect) { // Converte para um u8 numérico. Se não rolar, é porque deu uma // merda muito grande pois só deveria ter hex strings no hashmap. let num = u8::from_str_radix(s, 16).unwrap(); - let c = num as char; + // If changed byte is not printable use the non graphic char instead + let c = if (num as char).is_ascii_graphic() { + num as char + } else { + app.config.hex_mode_non_graphic_char + }; // Agora cria uma string a partir do char `c` // Parece doido, mas isso faz "41" -> 0x41 -> "A" let s = String::from(c);