summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorsharkdp <davidpeter@web.de>2020-05-24 16:19:07 +0200
committerDavid Peter <sharkdp@users.noreply.github.com>2020-05-25 11:51:10 +0200
commitfa25695b74fed1a5857e7f176ea43372256f9762 (patch)
treeb7f3b91f9167082212200ef85c01cbe7a00ca9d2
parent943b1f82b63506faff4f5d2e74c99d17de0b8535 (diff)
Make 'vcs_modification_markers' change non-breaking
-rw-r--r--CHANGELOG.md3
-rw-r--r--src/pretty_printer.rs9
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
}