1
0
mirror of https://github.com/sharkdp/bat.git synced 2025-09-14 17:22:25 +01:00

Add revisions for line-wrapping and terminal width.

* Adds separator.length() to calculation for desired width.
* Replaces use of term_width with options.term_width.
* Adds the comma and space separator to calculation for line-wrapping.
This commit is contained in:
Connor Kuehl
2018-05-08 12:20:45 -07:00
committed by David Peter
parent e5e47716b0
commit 7dc7133b3c
2 changed files with 5 additions and 6 deletions

View File

@@ -17,8 +17,6 @@ pub struct Printer<'a> {
impl<'a> Printer<'a> {
pub fn new(handle: &'a mut Write, options: &'a Options) -> Self {
let term_width = options.term_width;
let colors = if options.colored_output {
Colors::colored()
} else {
@@ -28,7 +26,7 @@ impl<'a> Printer<'a> {
Printer {
handle,
colors,
term_width,
term_width: options.term_width,
options,
line_changes: None,
}