Created
July 10, 2019 09:39
-
-
Save julienXX/6623fb366f9fced98e48bac2dc76f994 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn visit_url(s: &mut Cursive, url: &str) { | |
s.pop_layer(); | |
match get_data(&url) { | |
Ok(new_content) => { | |
let mut select = SelectView::new() | |
.h_align(HAlign::Left) | |
.autojump(); | |
s.add_layer(Dialog::info(url)); | |
select.add_all_str(new_content.lines()); | |
select.set_on_submit(|s,line| { | |
follow_link(s, line, url) | |
}); | |
s.add_layer( | |
Dialog::around(select.scrollable().full_screen()).title(url), | |
); | |
}, | |
Err(msg) => { | |
s.add_layer(Dialog::info(msg)); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm getting: