mirror of
https://github.com/sharkdp/bat.git
synced 2024-11-25 09:13:39 +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")]
|
||||
use crate::paging::PagingMode;
|
||||
use crate::printer::{InteractivePrinter, OutputHandle, Printer, SimplePrinter};
|
||||
use crate::style::{StyleComponent, StyleComponents};
|
||||
|
||||
use clircle::{Clircle, Identifier};
|
||||
|
||||
@ -174,8 +175,19 @@ impl<'b> Controller<'b> {
|
||||
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 {
|
||||
Box::new(SimplePrinter::new(self.config))
|
||||
Box::new(SimplePrinter::new(&config))
|
||||
} else {
|
||||
Box::new(InteractivePrinter::new(
|
||||
self.config,
|
||||
|
@ -1779,7 +1779,7 @@ fn file_with_invalid_utf8_filename() {
|
||||
.arg(file_path.as_os_str())
|
||||
.assert()
|
||||
.success()
|
||||
.stdout(" 1 dummy content\n");
|
||||
.stdout("dummy content\n");
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user