Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: preview files containing special \x1b characters as plain text and escape #1395

Merged
merged 8 commits into from
Aug 5, 2024
2 changes: 2 additions & 0 deletions yazi-plugin/src/external/highlighter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,8 @@ impl Highlighter {
buf.push(b'\n');
}

buf.iter_mut().filter(|&&mut b| b == b'\x1b').for_each(|b| *b = b'^');
Xerxes-2 marked this conversation as resolved.
Show resolved Hide resolved

if i > skip {
after.push(String::from_utf8_lossy(&buf).into_owned());
} else if !plain {
Expand Down