diff options
author | Dan Davison <dandavison7@gmail.com> | 2019-07-21 22:13:59 -0400 |
---|---|---|
committer | Dan Davison <dandavison7@gmail.com> | 2019-07-21 22:13:59 -0400 |
commit | 26bf4b60968375e8e26af5c4ef87759f37b29903 (patch) | |
tree | b4cd06ad4e29c00ab3fc4759b2ceb9833330f507 /src/paint.rs | |
parent | c1cd649d64f58e95287a228dcf736c0d81243c95 (diff) |
Don't paint zero-length text
Diffstat (limited to 'src/paint.rs')
-rw-r--r-- | src/paint.rs | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/paint.rs b/src/paint.rs index 9ba5e418..606dad25 100644 --- a/src/paint.rs +++ b/src/paint.rs @@ -156,6 +156,11 @@ impl<'a> Painter<'a> { /// Write section text to buffer with color escape codes. pub fn paint_text(text: &str, style: Style, output_buffer: &mut String) -> std::fmt::Result { use std::fmt::Write; + + if text.len() == 0 { + return Ok(()); + } + match style.background { style::NO_COLOR => (), _ => write!( |