1
0
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:
Connor Kuehl
2018-05-08 12:01:56 -07:00
committed by David Peter
parent b4f8cd3bae
commit e5e47716b0
2 changed files with 4 additions and 4 deletions

View File

@@ -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()