diff options
author | Dan Davison <dandavison7@gmail.com> | 2019-10-13 22:54:35 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-13 22:54:35 -0700 |
commit | 8b186b2dfc9f45610490138b850d6cb939525f04 (patch) | |
tree | 9bffcc150e0661f73ab76059968f29275d179447 | |
parent | b235110c1ed72fc581c2df41e85de2dc21377fe9 (diff) | |
parent | d6cb09eafe622598479cfa0b2ece63b8a91f5026 (diff) |
Merge pull request #22 from dandavison/10-allow-less-extra-column
Fix width calculation and terminating newline when writing underline
-rw-r--r-- | src/cli.rs | 2 | ||||
-rw-r--r-- | src/draw.rs | 3 |
2 files changed, 3 insertions, 2 deletions
@@ -175,7 +175,7 @@ pub fn process_command_line_arguments<'a>( .parse::<usize>() .unwrap_or_else(|_| panic!("Invalid width: {}", width)), ), - None => Some(terminal_width - 1), + None => Some(terminal_width), }; config::get_config( diff --git a/src/draw.rs b/src/draw.rs index bf3cf5f1..29670693 100644 --- a/src/draw.rs +++ b/src/draw.rs @@ -57,7 +57,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(()) } |