mirror of
https://github.com/sxyazi/yazi.git
synced 2026-07-25 08:41:05 +00:00
Revert "fix: preview ascii escape image in yazi#1391"
This reverts commit 9822fccc3b.
This commit is contained in:
parent
9822fccc3b
commit
9773ee1573
1 changed files with 2 additions and 8 deletions
10
yazi-plugin/src/external/highlighter.rs
vendored
10
yazi-plugin/src/external/highlighter.rs
vendored
|
|
@ -97,14 +97,8 @@ impl Highlighter {
|
|||
}
|
||||
|
||||
if plain {
|
||||
if after.iter().any(|l| l.contains('\x1b')) {
|
||||
let bytes = after.join("").bytes().collect::<Vec<_>>();
|
||||
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
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue