browser: edit current URL with "O"

Move "open last download" to M-o, as it is not that often used it seems.
This commit is contained in:
dece 2021-06-11 22:51:08 +02:00
parent 00d5e51e2f
commit bc8803d86b
2 changed files with 7 additions and 4 deletions

View file

@ -99,12 +99,12 @@ class Browser:
return self.dim[1] return self.dim[1]
@property @property
def current_url(self): def current_url(self) -> str:
"""Return the current URL.""" """Return the current URL."""
return self._current_url return self._current_url
@current_url.setter @current_url.setter
def current_url(self, url): def current_url(self, url: str):
"""Set the current URL and show it in the status line.""" """Set the current URL and show it in the status line."""
self._current_url = url self._current_url = url
self.set_status(url) self.set_status(url)
@ -244,7 +244,7 @@ class Browser:
elif char == ord("o"): elif char == ord("o"):
self.quick_command("open") self.quick_command("open")
elif char == ord("O"): elif char == ord("O"):
self.open_last_download() self.quick_command(f"open {self.current_url}")
elif char == ord("p"): elif char == ord("p"):
self.go_back() self.go_back()
elif char == ord("u"): elif char == ord("u"):
@ -291,6 +291,8 @@ class Browser:
self.scroll_page_vertically(-1) self.scroll_page_vertically(-1)
elif char == ord("l"): elif char == ord("l"):
self.scroll_page_horizontally(1) self.scroll_page_horizontally(1)
elif char == ord("o"):
self.open_last_download()
@property @property
def page_pad_size(self): def page_pad_size(self):

View file

@ -27,7 +27,8 @@ Keybinds using the SHIFT key are written uppercase. Keybinds using the ALT (or M
* gg: go to the top of the page * gg: go to the top of the page
* G: go to the bottom of the page * G: go to the bottom of the page
* o: open an URL * o: open an URL
* O: open last download with an external command * O: edit current URL
* M-o: open last download with an external command
* p: go to the previous page * p: go to the previous page
* u: go to the parent page (up a level in URL) * u: go to the parent page (up a level in URL)
* U: go to the root page (root URL for the current domain) * U: go to the root page (root URL for the current domain)