mirror of
https://github.com/sharkdp/bat.git
synced 2026-02-08 00:32:08 +00:00
Fix --list-themes pager init so less stays interactive
This commit is contained in:
@@ -205,6 +205,7 @@ pub fn list_themes(
|
||||
style.insert(StyleComponent::Plain);
|
||||
config.language = Some("Rust");
|
||||
config.style_components = StyleComponents(style);
|
||||
config.paging_mode = PagingMode::Always;
|
||||
|
||||
let mut output_type =
|
||||
OutputType::from_mode(config.paging_mode, config.wrapping_mode, config.pager)?;
|
||||
|
||||
@@ -141,16 +141,18 @@ impl OutputType {
|
||||
//
|
||||
// For newer versions (530 or 558 on Windows), we omit '--no-init' as it
|
||||
// is not needed anymore.
|
||||
match retrieve_less_version(&pager.bin) {
|
||||
None => {
|
||||
p.arg("--no-init");
|
||||
if single_screen_action == SingleScreenAction::Quit {
|
||||
match retrieve_less_version(&pager.bin) {
|
||||
None => {
|
||||
p.arg("--no-init");
|
||||
}
|
||||
Some(LessVersion::Less(version))
|
||||
if (version < 530 || (cfg!(windows) && version < 558)) =>
|
||||
{
|
||||
p.arg("--no-init");
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
Some(LessVersion::Less(version))
|
||||
if (version < 530 || (cfg!(windows) && version < 558)) =>
|
||||
{
|
||||
p.arg("--no-init");
|
||||
}
|
||||
_ => {}
|
||||
}
|
||||
} else {
|
||||
p.args(args);
|
||||
|
||||
Reference in New Issue
Block a user