diff --git a/yazi-plugin/src/external/highlighter.rs b/yazi-plugin/src/external/highlighter.rs index 8044fab3..0e681b96 100644 --- a/yazi-plugin/src/external/highlighter.rs +++ b/yazi-plugin/src/external/highlighter.rs @@ -97,14 +97,8 @@ impl Highlighter { } if plain { - if after.iter().any(|l| l.contains('\x1b')) { - let bytes = after.join("").bytes().collect::>(); - use ansi_to_tui::IntoText; - bytes.into_text().map_err(|e| PeekError::Unexpected(e.to_string())) - } else { - let indent = " ".repeat(PREVIEW.tab_size as usize); - Ok(Text::from(after.join("").replace('\t', &indent))) - } + let indent = " ".repeat(PREVIEW.tab_size as usize); + Ok(Text::from(after.join("").replace('\t', &indent))) } else { Self::highlight_with(before, after, syntax.unwrap()).await }