mirror of
https://github.com/sharkdp/bat.git
synced 2024-10-31 20:11:01 +01:00
Add bat::PrettyPrinter::clear_highlights
(fixes #1919)
This commit is contained in:
parent
113276a62b
commit
abd69f2deb
@ -229,6 +229,14 @@ impl<'a> PrettyPrinter<'a> {
|
||||
self
|
||||
}
|
||||
|
||||
/// Clear highlighted lines added by [`PrettyPrinter::highlight`] and
|
||||
/// [`PrettyPrinter::highlight_range`]. This is useful when reusing a
|
||||
/// `PrettyPrinter` instance for multiple different ranges.
|
||||
pub fn clear_highlights(&mut self) -> &mut Self {
|
||||
self.highlighted_lines.clear();
|
||||
self
|
||||
}
|
||||
|
||||
/// Specify the highlighting theme
|
||||
pub fn theme(&mut self, theme: impl AsRef<str>) -> &mut Self {
|
||||
self.config.theme = theme.as_ref().to_owned();
|
||||
|
Loading…
Reference in New Issue
Block a user