show error on non-match

pull/6/head
dvkt 5 years ago
parent 5de85657f6
commit 0331963758

@ -51,7 +51,6 @@ Just unzip/untar the `phetch` program into your $PATH and get going!
## todo
- [ ] ENTER on non-match is an error
- [ ] add credits page
- [ ] fork+exec telnet: gopher://bitreich.org/1/lawn/bbs

@ -498,7 +498,14 @@ impl Menu {
// self.searching == true
fn process_search_mode_char(&mut self, c: char) -> Action {
if c == '\n' {
return self.action_open();
if self.link_matching(0, &self.input).is_some() {
return self.action_open();
} else {
let input = self.input.clone();
self.searching = false;
self.input.clear();
return Action::Error(format!("No links match: {}", input));
}
}
self.input.push(c);

Loading…
Cancel
Save