diff --git a/README.md b/README.md index 249e3ce..184b464 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ A `` should be something like: +- gopher.floodgap.com/1/gopher - gopherproject.org - gopher://txtn.ws/ - forthworks.com/1/atua @@ -56,16 +57,18 @@ Just unzip/untar the `phetch` program into your $PATH and get going! - http://ascii-table.com/ansi-escape-sequences.php - http://www.lihaoyi.com/post/BuildyourownCommandLinewithANSIescapecodes.html -## TODO +## todo -### Basics +### basics - [ ] download to ~/Downloads +- [ ] prompt +- [ ] go to URL - [ ] `?` to show all keyboard shortcuts - [ ] save history to file - [ ] load history from file - [ ] load most recent URL when opening without args - [ ] ipv6 -### Bonus +### bonus - [ ] show loading spinner during gopher request - [ ] TLS - [ ] fuzzy find search links @@ -74,7 +77,7 @@ Just unzip/untar the `phetch` program into your $PATH and get going! - [ ] detect SIGWINCH - https://github.com/BurntSushi/chan-signal -## Screenies +## screenies ![Links](./img/links.png) diff --git a/src/menu/menu_view.rs b/src/menu/menu_view.rs index 5b5b030..27e5f42 100644 --- a/src/menu/menu_view.rs +++ b/src/menu/menu_view.rs @@ -330,9 +330,18 @@ impl MenuView { } } - fn action_select_link(&mut self, line: usize) -> Action { - if line < self.links().len() { - self.link = line; + fn action_select_link(&mut self, link: usize) -> Action { + if link < self.links().len() { + if let Some(&line) = self.links().get(link) { + if self.link_visibility(link) != Some(LinkDir::Visible) { + if line > SCROLL_LINES { + self.scroll = line - SCROLL_LINES; + } else { + self.scroll = 0; + } + } + } + self.link = link; Action::Redraw } else { Action::None