mirror of
https://github.com/zhigang1992/mitmproxy.git
synced 2026-04-24 04:14:57 +08:00
console: add g/G shortcuts throughout
g: go to end G: go to beginning
This commit is contained in:
@@ -309,6 +309,12 @@ class FlowListBox(urwid.ListBox):
|
||||
self.master.clear_flows()
|
||||
elif key == "e":
|
||||
self.master.toggle_eventlog()
|
||||
elif key == "G":
|
||||
self.master.state.set_focus(0)
|
||||
signals.flowlist_change.send(self)
|
||||
elif key == "g":
|
||||
self.master.state.set_focus(self.master.state.flow_count())
|
||||
signals.flowlist_change.send(self)
|
||||
elif key == "l":
|
||||
signals.status_prompt.send(
|
||||
prompt = "Limit",
|
||||
|
||||
@@ -28,6 +28,7 @@ class HelpView(urwid.ListBox):
|
||||
keys = [
|
||||
("j, k", "down, up"),
|
||||
("h, l", "left, right (in some contexts)"),
|
||||
("g, G", "go to end, beginning"),
|
||||
("space", "page down"),
|
||||
("pg up/down", "page up/down"),
|
||||
("arrows", "up, down, left, right"),
|
||||
|
||||
@@ -15,10 +15,8 @@ class Highlight(urwid.AttrMap):
|
||||
|
||||
class Searchable(urwid.ListBox):
|
||||
def __init__(self, state, contents):
|
||||
urwid.ListBox.__init__(
|
||||
self,
|
||||
urwid.SimpleFocusListWalker(contents)
|
||||
)
|
||||
self.walker = urwid.SimpleFocusListWalker(contents)
|
||||
urwid.ListBox.__init__(self, self.walker)
|
||||
self.state = state
|
||||
self.search_offset = 0
|
||||
self.current_highlight = None
|
||||
@@ -31,10 +29,16 @@ class Searchable(urwid.ListBox):
|
||||
text = "",
|
||||
callback = self.set_search
|
||||
)
|
||||
if key == "n":
|
||||
elif key == "n":
|
||||
self.find_next(False)
|
||||
if key == "N":
|
||||
elif key == "N":
|
||||
self.find_next(True)
|
||||
elif key == "G":
|
||||
self.set_focus(0)
|
||||
self.walker._modified()
|
||||
elif key == "g":
|
||||
self.set_focus(len(self.walker)-1)
|
||||
self.walker._modified()
|
||||
else:
|
||||
return super(self.__class__, self).keypress(size, key)
|
||||
|
||||
|
||||
@@ -24,7 +24,7 @@ update_settings = blinker.Signal()
|
||||
# Fired when a flow changes
|
||||
flow_change = blinker.Signal()
|
||||
|
||||
# Fired when the flow list changes
|
||||
# Fired when the flow list or focus changes
|
||||
flowlist_change = blinker.Signal()
|
||||
|
||||
# Pop and push view state onto a stack
|
||||
|
||||
Reference in New Issue
Block a user