diff options
author | Dan Davison <dandavison7@gmail.com> | 2019-10-13 22:10:28 -0700 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2019-10-13 22:50:39 -0700 |
commit | d6cb09eafe622598479cfa0b2ece63b8a91f5026 (patch) | |
tree | 27e10aed7401825cb57070fe7affe4c4ee0c627a /src/draw.rs | |
parent | 3280e66def4d41d7c8cb503c4e59a4eacd71268e (diff) |
Fix width calculation and terminating newline when writing underline
Fixes #10
Diffstat (limited to 'src/draw.rs')
-rw-r--r-- | src/draw.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/draw.rs b/src/draw.rs index 7211e620..316f5c38 100644 --- a/src/draw.rs +++ b/src/draw.rs @@ -48,7 +48,8 @@ pub fn write_underlined( heavy: bool, ) -> std::io::Result<()> { writeln!(writer, "{}", line_style.paint(text))?; - write_horizontal_line(writer, line_width, line_style, heavy)?; + write_horizontal_line(writer, line_width - 1, line_style, heavy)?; + write!(writer, "\n")?; Ok(()) } |