make bat -L use plain style

This commit is contained in:
Stefan Kunkel 2020-11-27 14:38:25 +01:00 committed by David Peter
parent cffacad306
commit bf96e6e642

View file

@ -36,6 +36,7 @@ use bat::{
input::Input, input::Input,
style::{StyleComponent, StyleComponents}, style::{StyleComponent, StyleComponents},
MappingTarget, MappingTarget,
PagingMode,
}; };
const THEME_PREVIEW_DATA: &[u8] = include_bytes!("../../../assets/theme_preview.rs"); const THEME_PREVIEW_DATA: &[u8] = include_bytes!("../../../assets/theme_preview.rs");
@ -248,9 +249,13 @@ fn run() -> Result<bool> {
if app.matches.is_present("list-languages") { if app.matches.is_present("list-languages") {
let languages: String = get_languages(&config)?; let languages: String = get_languages(&config)?;
let inputs: Vec<Input> = vec!(Input::from_reader(Box::new(languages.as_bytes()))); let inputs: Vec<Input> = vec![Input::from_reader(Box::new(languages.as_bytes()))];
let config = app.config(&inputs)?; let plain_config = Config {
run_controller(inputs, &config) style_components: StyleComponents::new(StyleComponent::Plain.components(false)),
paging_mode: PagingMode::QuitIfOneScreen,
..Default::default()
};
run_controller(inputs, &plain_config)
} else if app.matches.is_present("list-themes") { } else if app.matches.is_present("list-themes") {
list_themes(&config)?; list_themes(&config)?;
Ok(true) Ok(true)