@@ -94,7 +94,7 @@ impl<'a> Printer<'a> {
9494 regions: &[(highlighting::Style, &str)],
9595 ) -> Result<()> {
9696 let mut cursor: usize = 0;
97− let mut cursor_max: usize = self.config.term_width - 2;
97+ let mut cursor_max: usize = self.config.term_width;
9898
9999 // Line decoration.
100100 let decorations = self.gen_decorations(line_number);
@@ -116,6 +116,27 @@ impl<'a> Printer<'a> {
116116 // Grid border.
117117 let border = if gutter_width > 0 && self.config.output_components.grid() {
118118 self.gen_border()
119+ } else {
120+ PrintSegment {
121+ size: 0,
122+ text: "".to_owned(),
123+ }
124+ };
125+
126+ cursor_max -= border.size;
127+ write!(self.handle, "{}", border.text)?;
128+
129+ // Line contents.
130+ if self.config.output_wrap == OutputWrap::None {
131+ let true_color = self.config.true_color;
132+ let colored_output = self.config.colored_output;
133+
134+ write!(self.handle, "{}",
135+ regions.iter()
136+ .map(|&(style, text)| as_terminal_escaped(style, text, true_color, colored_output))
137+ .collect::<Vec<_>>()
138+ .join(" ")
139+ )?;
119140 } else {
120141 for &(style, text) in regions.iter() {
121142 let mut chars = text.chars().filter(|c| *c != '\n');
@@ -136,7 +157,7 @@ impl<'a> Printer<'a> {
136157 style,
137158 &*text,
138159 self.config.true_color,
139− self.config.colored_output
160+ self.config.colored_output,
140161 )
141162 )?;
142163 break;
@@ -155,7 +176,7 @@ impl<'a> Printer<'a> {
155176 style,
156177 &*text,
157178 self.config.true_color,
158− self.config.colored_output
179+ self.config.colored_output,
159180 ),
160181 " ".repeat(gutter_width),
161182 border.text.to_owned()