mirror of
				https://github.com/sharkdp/bat.git
				synced 2025-11-04 09:01:56 +00:00 
			
		
		
		
	Changed preview code
This commit is contained in:
		@@ -1,6 +0,0 @@
 | 
			
		||||
 | 
			
		||||
// Hello World
 | 
			
		||||
fn main() {
 | 
			
		||||
    println!("Hello World!");
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										5
									
								
								assets/theme_preview.rs
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										5
									
								
								assets/theme_preview.rs
									
									
									
									
									
										Normal file
									
								
							@@ -0,0 +1,5 @@
 | 
			
		||||
// Output the square of a number.
 | 
			
		||||
fn print_square(num: f64) {
 | 
			
		||||
    let result = f64::powf(num, 2.0);
 | 
			
		||||
    println!("The square of {:.2} is {:.2}.", num, result);
 | 
			
		||||
}
 | 
			
		||||
@@ -134,12 +134,13 @@ pub fn list_themes(assets: &HighlightingAssets, config: &mut Config) {
 | 
			
		||||
    let themes = &assets.theme_set.themes;
 | 
			
		||||
    let mut style = HashSet::new();
 | 
			
		||||
    style.insert(OutputComponent::Plain);
 | 
			
		||||
    config.files = vec![Some("assets/hello.rs")];
 | 
			
		||||
    config.files = vec![Some("assets/theme_preview.rs")];
 | 
			
		||||
    config.output_components = OutputComponents(style);
 | 
			
		||||
    for (theme, _) in themes.iter() {
 | 
			
		||||
        println!("{}", theme);
 | 
			
		||||
        println!("{}\n", theme);
 | 
			
		||||
        config.theme = theme.to_string();
 | 
			
		||||
        let _controller = Controller::new(&config, &assets).run();
 | 
			
		||||
        println!("--------------------------------\n");
 | 
			
		||||
    }
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user