diff options
author | Andy Wortman <ixineeringeverywhere@gmail.com> | 2017-12-24 23:09:57 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-24 23:09:57 -0800 |
commit | 575b6858a5849547acfe43a783ef03146a373215 (patch) | |
tree | cffb070e4cef1baa71d968143bec5925cdbe92af /src/display | |
parent | 2ad6338ffb2c1cf37acd54bd8c2997d051dd02e6 (diff) | |
parent | dd687928318cd0b4cad76228b80d1959c1319997 (diff) |
Merge pull request #3 from iximeow/assorted-fixes
Assorted fixes
Diffstat (limited to 'src/display')
-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; |