Make 'vcs_modification_markers' change non-breaking

This commit is contained in:
sharkdp 2020-05-24 16:19:07 +02:00 committed by David Peter
parent 943b1f82b6
commit fa25695b74
2 changed files with 7 additions and 5 deletions

View File

@ -20,9 +20,8 @@
- SML, see #1005 (@kopecs)
## New themes
## `bat` as a library
- `PrettyPrinter::vcs_modification_markers` is no longer available without the `git` feature, see #997 (@eth-p)
## `bat` as a library
## Packaging

View File

@ -165,10 +165,13 @@ impl<'a> PrettyPrinter<'a> {
self
}
/// Whether to show modification markers for VCS changes
#[cfg(feature = "git")]
/// Whether to show modification markers for VCS changes. This has no effect if
/// the `git` feature is not activated.
pub fn vcs_modification_markers(&mut self, yes: bool) -> &mut Self {
self.active_style_components.vcs_modification_markers = yes;
#[cfg(feature = "git")]
{
self.active_style_components.vcs_modification_markers = yes;
}
self
}