mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-18 02:30:55 +01:00
Added switch to plain style as default:w in case of loop_through = true
This commit is contained in:
parent
c0c1fd69bc
commit
2ba681315c
@ -15,6 +15,7 @@ use crate::output::OutputType;
|
|||||||
#[cfg(feature = "paging")]
|
#[cfg(feature = "paging")]
|
||||||
use crate::paging::PagingMode;
|
use crate::paging::PagingMode;
|
||||||
use crate::printer::{InteractivePrinter, OutputHandle, Printer, SimplePrinter};
|
use crate::printer::{InteractivePrinter, OutputHandle, Printer, SimplePrinter};
|
||||||
|
use crate::style::{StyleComponent, StyleComponents};
|
||||||
|
|
||||||
use clircle::{Clircle, Identifier};
|
use clircle::{Clircle, Identifier};
|
||||||
|
|
||||||
@ -174,8 +175,19 @@ impl<'b> Controller<'b> {
|
|||||||
None
|
None
|
||||||
};
|
};
|
||||||
|
|
||||||
|
let mut config = self.config.clone();
|
||||||
|
|
||||||
|
if self.config.loop_through {
|
||||||
|
config = Config {
|
||||||
|
style_components: StyleComponents(
|
||||||
|
[StyleComponent::Plain].iter().cloned().collect(),
|
||||||
|
),
|
||||||
|
..self.config.clone()
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
let mut printer: Box<dyn Printer> = if self.config.loop_through {
|
let mut printer: Box<dyn Printer> = if self.config.loop_through {
|
||||||
Box::new(SimplePrinter::new(self.config))
|
Box::new(SimplePrinter::new(&config))
|
||||||
} else {
|
} else {
|
||||||
Box::new(InteractivePrinter::new(
|
Box::new(InteractivePrinter::new(
|
||||||
self.config,
|
self.config,
|
||||||
|
@ -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(" 1 dummy content\n");
|
.stdout("dummy content\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
Loading…
Reference in New Issue
Block a user