mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-11-04 00:51:56 +00:00 
			
		
		
		
	Allow configuring show_nonprintable from PrettyPrinter
This commit is contained in:
		@@ -19,6 +19,7 @@
 | 
			
		||||
 | 
			
		||||
## `bat` as a library
 | 
			
		||||
 | 
			
		||||
- Allow crates using `bat` as a library to configure `show_nonprintable` with `PrettyPrinter`, see #2142
 | 
			
		||||
 | 
			
		||||
# v0.20.0
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -164,6 +164,12 @@ impl<'a> PrettyPrinter<'a> {
 | 
			
		||||
        self
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// Whether to print binary content or nonprintable characters (default: no)
 | 
			
		||||
    pub fn show_nonprintable(&mut self, yes: bool) -> &mut Self {
 | 
			
		||||
        self.config.show_nonprintable = yes;
 | 
			
		||||
        self
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /// Whether to show "snip" markers between visible line ranges (default: no)
 | 
			
		||||
    pub fn snip(&mut self, yes: bool) -> &mut Self {
 | 
			
		||||
        self.active_style_components.snip = yes;
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user