mirror of
https://github.com/sharkdp/bat.git
synced 2025-09-14 17:22:25 +01:00
Add term_width to options struct, move getting term_width to run()
This commit is contained in:
committed by
David Peter
parent
b4f8cd3bae
commit
e5e47716b0
@@ -1,5 +1,4 @@
|
||||
use ansi_term::Style;
|
||||
use console::Term;
|
||||
use errors::*;
|
||||
use std::io::Write;
|
||||
use syntect::highlighting;
|
||||
@@ -18,8 +17,7 @@ pub struct Printer<'a> {
|
||||
|
||||
impl<'a> Printer<'a> {
|
||||
pub fn new(handle: &'a mut Write, options: &'a Options) -> Self {
|
||||
let (_, term_width) = Term::stdout().size();
|
||||
let term_width = term_width as usize;
|
||||
let term_width = options.term_width;
|
||||
|
||||
let colors = if options.colored_output {
|
||||
Colors::colored()
|
||||
|
Reference in New Issue
Block a user