Skip to content

Commit

Permalink
add page-up/down key functions and the vim bindings for them
Browse files Browse the repository at this point in the history
  • Loading branch information
elig0n authored and firecat53 committed Oct 11, 2024
1 parent 56b54dd commit f842434
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions urlscan/urlchoose.py
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ def __init__(self, extractedurls, compact=False, reverse=False, nohelp=False, de
'C': self._clipboard,
'c': self._context,
'ctrl l': self._clear_screen,
'ctrl f': self._page_down,
'ctrl b': self._page_up,
'd': self._del_url,
'f1': self._help_menu,
'G': self._bottom,
Expand Down Expand Up @@ -546,6 +548,16 @@ def _next(self):
self.top.base_widget.body.focus_position = target_position
self.top.base_widget.keypress(self.size, "") # Trick urwid into redisplaying the cursor

def _page_up(self):
""" Ctrl-b """
self.top.base_widget.keypress(self.size, "page up")
self.top.base_widget.keypress(self.size, "") # Trick urwid into redisplaying the cursor

def _page_down(self):
""" Ctrl-f """
self.top.base_widget.keypress(self.size, "page down")
self.top.base_widget.keypress(self.size, "") # Trick urwid into redisplaying the cursor

def _previous(self):
""" K """
current_position = self.top.base_widget.body.focus_position
Expand Down

0 comments on commit f842434

Please sign in to comment.