mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-21 20:38:44 +00:00
parent
4e491c4594
commit
7929179a74
@ -19,7 +19,7 @@ use crate::paging::PagingMode;
|
|||||||
|
|
||||||
#[derive(Default)]
|
#[derive(Default)]
|
||||||
struct ActiveStyleComponents {
|
struct ActiveStyleComponents {
|
||||||
header: bool,
|
header_filename: bool,
|
||||||
#[cfg(feature = "git")]
|
#[cfg(feature = "git")]
|
||||||
vcs_modification_markers: bool,
|
vcs_modification_markers: bool,
|
||||||
grid: bool,
|
grid: bool,
|
||||||
@ -140,7 +140,7 @@ impl<'a> PrettyPrinter<'a> {
|
|||||||
|
|
||||||
/// Whether to show a header with the file name
|
/// Whether to show a header with the file name
|
||||||
pub fn header(&mut self, yes: bool) -> &mut Self {
|
pub fn header(&mut self, yes: bool) -> &mut Self {
|
||||||
self.active_style_components.header = yes;
|
self.active_style_components.header_filename = yes;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -277,8 +277,10 @@ impl<'a> PrettyPrinter<'a> {
|
|||||||
if self.active_style_components.rule {
|
if self.active_style_components.rule {
|
||||||
self.config.style_components.insert(StyleComponent::Rule);
|
self.config.style_components.insert(StyleComponent::Rule);
|
||||||
}
|
}
|
||||||
if self.active_style_components.header {
|
if self.active_style_components.header_filename {
|
||||||
self.config.style_components.insert(StyleComponent::Header);
|
self.config
|
||||||
|
.style_components
|
||||||
|
.insert(StyleComponent::HeaderFilename);
|
||||||
}
|
}
|
||||||
if self.active_style_components.line_numbers {
|
if self.active_style_components.line_numbers {
|
||||||
self.config
|
self.config
|
||||||
|
Loading…
x
Reference in New Issue
Block a user