1
0
mirror of https://github.com/sharkdp/bat synced 2026-08-03 18:51:44 +00:00

Remove double backspace scan

This commit is contained in:
Alex Kirk
2025-12-11 05:19:21 +01:00
parent 64a4b204a2
commit f97f9ebf03
2 changed files with 18 additions and 27 deletions
+4 -3
View File
@@ -1,4 +1,3 @@
use std::borrow::Cow;
use std::vec::Vec;
use nu_ansi_term::Color::{Fixed, Green, Red, Yellow};
@@ -634,8 +633,10 @@ impl Printer for InteractivePrinter<'_> {
}
};
if self.strip_overstrike && line.contains('\x08') {
line = Cow::Owned(strip_overstrike(&line).into_owned());
if self.strip_overstrike {
if let Some(pos) = line.find('\x08') {
line = strip_overstrike(&line, pos).into();
}
}
// If ANSI escape sequences are supposed to be stripped, do it before syntax highlighting.