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
+3
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)?;
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ 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.
|
||||||
|
if single_screen_action == SingleScreenAction::Quit {
|
||||||
match retrieve_less_version(&pager.bin) {
|
match retrieve_less_version(&pager.bin) {
|
||||||
None => {
|
None => {
|
||||||
p.arg("--no-init");
|
p.arg("--no-init");
|
||||||
@@ -152,6 +153,7 @@ impl OutputType {
|
|||||||
}
|
}
|
||||||
_ => {}
|
_ => {}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
p.args(args);
|
p.args(args);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user