summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEthan P <eth-p+git@hidden.email>2020-12-16 18:16:00 -0800
committereinfachIrgendwer0815 <85333734+einfachIrgendwer0815@users.noreply.github.com>2024-02-24 13:51:05 +0100
commit0c7e5299bf05d24c22dbff85964acec26ea3edf4 (patch)
tree8945e0678fffae883bf6760fd1f4eb4a79492d2a
parentc36ed3281694375a5ee85b86c2c710073c1195dd (diff)
Add squeeze_empty_lines to PrettyPrinter
-rw-r--r--src/pretty_printer.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pretty_printer.rs b/src/pretty_printer.rs
index 121637f1..614f0c91 100644
--- a/src/pretty_printer.rs
+++ b/src/pretty_printer.rs
@@ -230,6 +230,13 @@ impl<'a> PrettyPrinter<'a> {
self
}
+ /// Specify the maximum number of consecutive empty lines to print.
+ /// If set to `0`, all empty lines will be shown.
+ pub fn squeeze_empty_lines(&mut self, maximum: usize) -> &mut Self {
+ self.config.squeeze_lines = maximum;
+ self
+ }
+
/// Specify the highlighting theme
pub fn theme(&mut self, theme: impl AsRef<str>) -> &mut Self {
self.config.theme = theme.as_ref().to_owned();