From a4f05a40e2f7146f429fef26a96c91a41baba499 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sat, 11 Nov 2017 04:35:35 -0800 Subject: start adding help reference --- src/display/mod.rs | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src/display') diff --git a/src/display/mod.rs b/src/display/mod.rs index 0eeba68..6df3b28 100644 --- a/src/display/mod.rs +++ b/src/display/mod.rs @@ -25,7 +25,8 @@ pub enum Infos { Thread(Vec), Event(tw::events::Event), DM(String), - User(tw::user::User) + User(tw::user::User), + Text(Vec) } const COMPOSE_HEIGHT: u16 = 5; @@ -164,6 +165,10 @@ pub fn paint(tweeter: &mut ::tw::TwitterCache) -> Result<(), std::io::Error> { for info in last_few_twevent { let to_draw: Vec = match info { + Infos::Text(lines) => { + let wrapped = into_display_lines(lines, width); + wrapped.into_iter().rev().collect() + } Infos::Tweet(id) => { let pre_split: Vec = render_twete(&id, tweeter); let total_length: usize = pre_split.iter().map(|x| x.len()).sum(); @@ -411,7 +416,7 @@ pub fn render_twete(twete_id: &TweetId, tweeter: &mut tw::TwitterCache) -> Vec