on master help sign in
Make 'vcs_modification_markers' change non-breaking
commitfa25695b74fed1a5857e7f176ea43372256f9762 authorsharkdp <davidpeter@web.de> dateSun 24 May 2020, 16:19 (6 years ago) parent943b1f8
2 files changed+7−5
CHANGELOG.md+1−2 src/pretty_printer.rs+6−3
CHANGELOG.md+1−2
@@ -20,9 +20,8 @@
2020- SML, see #1005 (@kopecs)
2121
2222## New themes
23−## `bat` as a library
2423
25−- `PrettyPrinter::vcs_modification_markers` is no longer available without the `git` feature, see #997 (@eth-p)
24+## `bat` as a library
2625
2726## Packaging
2827
src/pretty_printer.rs+6−3
@@ -165,10 +165,13 @@ impl<'a> PrettyPrinter<'a> {
165165 self
166166 }
167167
168− /// Whether to show modification markers for VCS changes
169− #[cfg(feature = "git")]
168+ /// Whether to show modification markers for VCS changes. This has no effect if
169+ /// the `git` feature is not activated.
170170 pub fn vcs_modification_markers(&mut self, yes: bool) -> &mut Self {
171− self.active_style_components.vcs_modification_markers = yes;
171+ #[cfg(feature = "git")]
172+ {
173+ self.active_style_components.vcs_modification_markers = yes;
174+ }
172175 self
173176 }
174177