mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-30 10:06:12 +00:00
Fix --list-themes pager init so less stays interactive
This commit is contained in:
1 parent
a8140f91cc
commit
1852dea96a
2 files changed
+12
-9
No files matched your search
@@ -205,6 +205,7 @@ pub fn list_themes(
|
|||||||
style.insert(StyleComponent::Plain);
|
style.insert(StyleComponent::Plain);
|
||||||
config.language = Some("Rust");
|
config.language = Some("Rust");
|
||||||
config.style_components = StyleComponents(style);
|
config.style_components = StyleComponents(style);
|
||||||
|
config.paging_mode = PagingMode::Always;
|
||||||
|
|
||||||
let mut output_type =
|
let mut output_type =
|
||||||
OutputType::from_mode(config.paging_mode, config.wrapping_mode, config.pager)?;
|
OutputType::from_mode(config.paging_mode, config.wrapping_mode, config.pager)?;
|
||||||
|
|||||||
+11
-9
@@ -141,16 +141,18 @@ impl OutputType {
|
|||||||
//
|
//
|
||||||
// For newer versions (530 or 558 on Windows), we omit '--no-init' as it
|
// For newer versions (530 or 558 on Windows), we omit '--no-init' as it
|
||||||
// is not needed anymore.
|
// is not needed anymore.
|
||||||
match retrieve_less_version(&pager.bin) {
|
if single_screen_action == SingleScreenAction::Quit {
|
||||||
None => {
|
match retrieve_less_version(&pager.bin) {
|
||||||
p.arg("--no-init");
|
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 {
|
} else {
|
||||||
p.args(args);
|
p.args(args);
|
||||||
|
|||||||
Reference in new issue
Block a user