mirror of
https://github.com/sharkdp/bat.git
synced 2025-08-18 20:10:13 +02:00
Added current line number prefix
This commit is contained in:
@@ -165,7 +165,8 @@ impl<'a> Printer for SimplePrinter<'a> {
|
|||||||
} else {
|
} else {
|
||||||
match handle {
|
match handle {
|
||||||
OutputHandle::IoWrite(handle) => {
|
OutputHandle::IoWrite(handle) => {
|
||||||
if self.config.style_components.numbers() && !std::io::stdout().is_terminal()
|
if self.config.style_components.numbers()
|
||||||
|
&& !std::io::stdout().is_terminal()
|
||||||
{
|
{
|
||||||
handle.write_all(
|
handle.write_all(
|
||||||
format!("{line_number:4} {}", String::from_utf8_lossy(line_buffer))
|
format!("{line_number:4} {}", String::from_utf8_lossy(line_buffer))
|
||||||
|
@@ -1779,7 +1779,7 @@ fn file_with_invalid_utf8_filename() {
|
|||||||
.arg(file_path.as_os_str())
|
.arg(file_path.as_os_str())
|
||||||
.assert()
|
.assert()
|
||||||
.success()
|
.success()
|
||||||
.stdout("dummy content\n");
|
.stdout(" 1 dummy content\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Reference in New Issue
Block a user