From cba9df746e9a719c59563962ff815210d8304833 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Wed, 22 Apr 2020 21:53:01 +0200 Subject: [PATCH] Add paging to advanced example --- examples/advanced.rs | 3 ++- src/lib.rs | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/advanced.rs b/examples/advanced.rs index e54a391c..ec90c160 100644 --- a/examples/advanced.rs +++ b/examples/advanced.rs @@ -1,5 +1,5 @@ /// A program that prints its own source code using the bat library -use bat::{LineRange, PrettyPrinter, WrappingMode}; +use bat::{LineRange, PrettyPrinter, WrappingMode, PagingMode}; fn main() { PrettyPrinter::new() @@ -11,6 +11,7 @@ fn main() { .highlight(LineRange::new(line!() as usize, line!() as usize)) .theme("1337") .wrapping_mode(WrappingMode::Character) + .paging_mode(PagingMode::QuitIfOneScreen) .input_file(file!()) .print() .unwrap(); diff --git a/src/lib.rs b/src/lib.rs index b57247a5..b7ab1d20 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -41,3 +41,6 @@ pub use line_range::LineRange; pub use pretty_printer::PrettyPrinter; pub use syntax_mapping::{MappingTarget, SyntaxMapping}; pub use wrapping::WrappingMode; + +#[cfg(feature = "paging")] +pub use config::PagingMode;