Add squeeze_empty_lines to PrettyPrinter

This commit is contained in:
Ethan P 2020-12-16 18:16:00 -08:00 committed by einfachIrgendwer0815
parent c36ed32816
commit 0c7e5299bf
No known key found for this signature in database
GPG Key ID: 58D55E5F117DA873
1 changed files with 7 additions and 0 deletions

View File

@ -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();