From 5ea20229fbbe48bac93a560c4aa057e35fbf26fa Mon Sep 17 00:00:00 2001 From: Xerxes-2 Date: Fri, 2 Aug 2024 16:55:00 +1000 Subject: [PATCH] fix: tread esc as space in code previewer --- yazi-plugin/src/external/highlighter.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/yazi-plugin/src/external/highlighter.rs b/yazi-plugin/src/external/highlighter.rs index 0e681b96..11a06b3a 100644 --- a/yazi-plugin/src/external/highlighter.rs +++ b/yazi-plugin/src/external/highlighter.rs @@ -84,6 +84,12 @@ impl Highlighter { buf.push(b'\n'); } + buf.iter_mut().for_each(|b| { + if *b == 27 { + *b = b' ' + } + }); + if i > skip { after.push(String::from_utf8_lossy(&buf).into_owned()); } else if !plain {