mirror of
https://github.com/sharkdp/bat.git
synced 2026-10-30 10:06:12 +00: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:
1 parent
e5e47716b0
commit
7dc7133b3c
2 files changed
+5
-6
No files matched your search
+1
-3
@@ -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