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:
committed by
David Peter
parent
e5e47716b0
commit
7dc7133b3c
@@ -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,
|
||||
}
|
||||
|
Reference in New Issue
Block a user