From fa25695b74fed1a5857e7f176ea43372256f9762 Mon Sep 17 00:00:00 2001 From: sharkdp Date: Sun, 24 May 2020 16:19:07 +0200 Subject: [PATCH] Make 'vcs_modification_markers' change non-breaking --- CHANGELOG.md | 3 +-- src/pretty_printer.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d8102a1..263f1d9f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/src/pretty_printer.rs b/src/pretty_printer.rs index da60abbd..7ce7a70c 100644 --- a/src/pretty_printer.rs +++ b/src/pretty_printer.rs @@ -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 }