@@ -30,8 +30,8 @@ use crate::errors::*;
30use crate::inputfile::{InputFile, InputFileReader};
30use crate::inputfile::{InputFile, InputFileReader};
31use crate::line_range::RangeCheckResult;
31use crate::line_range::RangeCheckResult;
32use crate::preprocessor::{expand_tabs, replace_nonprintable};
32use crate::preprocessor::{expand_tabs, replace_nonprintable};
33−use crate::style::OutputWrap;
34use crate::terminal::{as_terminal_escaped, to_ansi_color};
33use crate::terminal::{as_terminal_escaped, to_ansi_color};
34+use crate::wrap::OutputWrap;
36pub trait Printer {
36pub trait Printer {
37 fn print_header(&mut self, handle: &mut dyn Write, file: InputFile) -> Result<()>;
37 fn print_header(&mut self, handle: &mut dyn Write, file: InputFile) -> Result<()>;
@@ -116,11 +116,11 @@ impl<'a> InteractivePrinter<'a> {
116 // Create decorations.
116 // Create decorations.
117 let mut decorations: Vec<Box<dyn Decoration>> = Vec::new();
117 let mut decorations: Vec<Box<dyn Decoration>> = Vec::new();
119− if config.output_components.numbers() {
119+ if config.style_components.numbers() {
120 decorations.push(Box::new(LineNumberDecoration::new(&colors)));
120 decorations.push(Box::new(LineNumberDecoration::new(&colors)));
123− if config.output_components.changes() {
123+ if config.style_components.changes() {
124 decorations.push(Box::new(LineChangesDecoration::new(&colors)));
124 decorations.push(Box::new(LineChangesDecoration::new(&colors)));
@@ -130,7 +130,7 @@ impl<'a> InteractivePrinter<'a> {
130 // The grid border decoration isn't added until after the panel_width calculation, since the
130 // The grid border decoration isn't added until after the panel_width calculation, since the
131 // print_horizontal_line, print_header, and print_footer functions all assume the panel
131 // print_horizontal_line, print_header, and print_footer functions all assume the panel
132 // width is without the grid border.
132 // width is without the grid border.
133− if config.output_components.grid() && !decorations.is_empty() {
133+ if config.style_components.grid() && !decorations.is_empty() {
134 decorations.push(Box::new(GridBorderDecoration::new(&colors)));
134 decorations.push(Box::new(GridBorderDecoration::new(&colors)));
@@ -152,7 +152,7 @@ impl<'a> InteractivePrinter<'a> {
154 // Get the Git modifications
154 // Get the Git modifications
155− line_changes = if config.output_components.changes() {
155+ line_changes = if config.style_components.changes() {
156 match file {
156 match file {
157 InputFile::Ordinary(filename) => get_git_diff(filename),
157 InputFile::Ordinary(filename) => get_git_diff(filename),
158 _ => None,
158 _ => None,
@@ -206,7 +206,7 @@ impl<'a> InteractivePrinter<'a> {
206 text_truncated,
206 text_truncated,
207 " ".repeat(self.panel_width - 1 - text_truncated.len())
207 " ".repeat(self.panel_width - 1 - text_truncated.len())
209− if self.config.output_components.grid() {
209+ if self.config.style_components.grid() {
210 format!("{} │ ", text_filled)
210 format!("{} │ ", text_filled)
212 format!("{}", text_filled)
212 format!("{}", text_filled)
@@ -225,7 +225,7 @@ impl<'a> InteractivePrinter<'a> {
226impl<'a> Printer for InteractivePrinter<'a> {
226impl<'a> Printer for InteractivePrinter<'a> {
227 fn print_header(&mut self, handle: &mut dyn Write, file: InputFile) -> Result<()> {
227 fn print_header(&mut self, handle: &mut dyn Write, file: InputFile) -> Result<()> {
228− if !self.config.output_components.header() {
228+ if !self.config.style_components.header() {
229 if Some(ContentType::BINARY) == self.content_type && !self.config.show_nonprintable {
229 if Some(ContentType::BINARY) == self.content_type && !self.config.show_nonprintable {
230 let input = match file {
230 let input = match file {
231 InputFile::Ordinary(filename) => {
231 InputFile::Ordinary(filename) => {
@@ -243,14 +243,14 @@ impl<'a> Printer for InteractivePrinter<'a> {
246− if self.config.output_components.grid() {
246+ if self.config.style_components.grid() {
247 self.print_horizontal_line(handle, '┬')?;
247 self.print_horizontal_line(handle, '┬')?;
250 return Ok(());
250 return Ok(());
253− if self.config.output_components.grid() {
253+ if self.config.style_components.grid() {
254 self.print_horizontal_line(handle, '┬')?;
254 self.print_horizontal_line(handle, '┬')?;
@@ -286,7 +286,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
289− if self.config.output_components.grid() {
289+ if self.config.style_components.grid() {
290 if self.content_type.map_or(false, |c| c.is_text()) || self.config.show_nonprintable {
290 if self.content_type.map_or(false, |c| c.is_text()) || self.config.show_nonprintable {
291 self.print_horizontal_line(handle, '┼')?;
291 self.print_horizontal_line(handle, '┼')?;
@@ -298,7 +298,7 @@ impl<'a> Printer for InteractivePrinter<'a> {
300 fn print_footer(&mut self, handle: &mut dyn Write) -> Result<()> {
300 fn print_footer(&mut self, handle: &mut dyn Write) -> Result<()> {
301− if self.config.output_components.grid()
301+ if self.config.style_components.grid()
302 && (self.content_type.map_or(false, |c| c.is_text()) || self.config.show_nonprintable)
302 && (self.content_type.map_or(false, |c| c.is_text()) || self.config.show_nonprintable)
304 self.print_horizontal_line(handle, '┴')
304 self.print_horizontal_line(handle, '┴')