summaryrefslogtreecommitdiffstats
path: root/src/draw.rs
diff options
context:
space:
mode:
authorDan Davison <dandavison7@gmail.com>2020-05-28 11:39:11 -0400
committerDan Davison <dandavison7@gmail.com>2020-05-28 15:39:11 -0400
commit470fb46a0a23052ea40ddc0906175d9ca54a18cb (patch)
treecb71fdfe4769b39ba2152e41db3a0ebfe7574549 /src/draw.rs
parentdc3b9dbf08d3821942b6608524f6db4464ce081b (diff)
Bug fix: hunk header background color was not reaching box line
Diffstat (limited to 'src/draw.rs')
-rw-r--r--src/draw.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/draw.rs b/src/draw.rs
index 90444e64..2f205a58 100644
--- a/src/draw.rs
+++ b/src/draw.rs
@@ -21,7 +21,7 @@ pub fn write_boxed(
} else {
box_drawing::light::UP_LEFT
};
- let box_width = UnicodeWidthStr::width(strip_ansi_codes(text).as_ref()) + 1;
+ let box_width = UnicodeWidthStr::width(strip_ansi_codes(text).as_ref());
write_boxed_partial(writer, text, box_width, text_style, decoration_style, heavy)?;
write!(writer, "{}", decoration_style.paint(up_left))?;
Ok(())
@@ -37,7 +37,7 @@ pub fn write_boxed_with_line(
decoration_style: ansi_term::Style,
heavy: bool,
) -> std::io::Result<()> {
- let box_width = UnicodeWidthStr::width(strip_ansi_codes(text).as_ref()) + 1;
+ let box_width = UnicodeWidthStr::width(strip_ansi_codes(text).as_ref());
write_boxed_with_horizontal_whisker(
writer,
text,
@@ -215,7 +215,7 @@ fn write_boxed_partial(
let horizontal_edge = horizontal.repeat(box_width);
write!(
writer,
- "{}{}\n{} {}\n{}",
+ "{}{}\n{}{}\n{}",
decoration_style.paint(&horizontal_edge),
decoration_style.paint(down_left),
text_style.paint(text),