diff options
author | iximeow <me@iximeow.net> | 2017-12-24 23:09:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-24 23:09:57 -0800 |
commit | 023e4bc607760528e96d7e11214d9223ad4ff616 (patch) | |
tree | cffb070e4cef1baa71d968143bec5925cdbe92af /src/display/mod.rs | |
parent | 56bc160844b3561ae3566490352e2b2c8b416d51 (diff) | |
parent | 1039160d4e4400e248afcbce2903c2696c2e0679 (diff) |
Merge pull request #3 from iximeow/assorted-fixes
Assorted fixes
Diffstat (limited to 'src/display/mod.rs')
-rw-r--r-- | src/display/mod.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/display/mod.rs b/src/display/mod.rs index 37de481..6115472 100644 --- a/src/display/mod.rs +++ b/src/display/mod.rs @@ -412,7 +412,7 @@ pub fn paint(tweeter: &::tw::TwitterCache, display_info: &mut DisplayInfo) -> Re { let to_show = display_info.log[first_tail_log..last_tail_log].iter().rev(); for line in to_show { - print!("{}{}{}/{}: {}", cursor::Goto(1, height - i), clear::CurrentLine, display_info.log.len() - 1 - i as usize, display_info.log.len() - 1, line); + print!("{}{}{}/{}: {}", cursor::Goto(1, height - i), clear::CurrentLine, display_info.log.len() - 1 - i as usize, display_info.log.len() - 1, line.chars().take(width.saturating_sub(7) as usize).collect::<String>()); i = i + 1; } } @@ -472,7 +472,7 @@ pub fn paint(tweeter: &::tw::TwitterCache, display_info: &mut DisplayInfo) -> Re Some(DisplayMode::Reply(twid, msg)) => { let mut lines: Vec<String> = vec![]; lines.push(std::iter::repeat("-").take((width as usize).saturating_sub(2)).collect()); - lines.extend(render_twete(&twid, tweeter, display_info, Some(width))); + lines.extend(render_twete(&twid, tweeter, display_info, Some(width - 2))); let reply_delineator = "--------reply"; lines.push(format!("{}{}", reply_delineator, std::iter::repeat("-").take((width as usize).saturating_sub(reply_delineator.len() + 2)).collect::<String>())); let msg_lines = into_display_lines(msg.split("\n").map(|x| x.to_owned()).collect(), width - 2); @@ -561,7 +561,7 @@ pub fn paint(tweeter: &::tw::TwitterCache, display_info: &mut DisplayInfo) -> Re } }; for line in to_draw { - print!("{}{}{}", cursor::Goto(1, height - h), clear::CurrentLine, line); + print!("{}{}{}", cursor::Goto(1, height - h), line, clear::UntilNewline); h = h + 1; if h >= height { break; |