From 0c7e5299bf05d24c22dbff85964acec26ea3edf4 Mon Sep 17 00:00:00 2001 From: Ethan P Date: Wed, 16 Dec 2020 18:16:00 -0800 Subject: [PATCH] Add squeeze_empty_lines to PrettyPrinter --- src/pretty_printer.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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) -> &mut Self { self.config.theme = theme.as_ref().to_owned();