mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2025-02-01 15:55:28 +00:00
console: make g/G shortcuts work in more contexts
This commit is contained in:
parent
d20069fcd2
commit
ff654730e8
@ -47,6 +47,10 @@ class EventListBox(urwid.ListBox):
|
|||||||
if key == "C":
|
if key == "C":
|
||||||
self.master.clear_events()
|
self.master.clear_events()
|
||||||
key = None
|
key = None
|
||||||
|
elif key == "G":
|
||||||
|
self.set_focus(0)
|
||||||
|
elif key == "g":
|
||||||
|
self.set_focus(len(self.master.eventlist)-1)
|
||||||
return urwid.ListBox.keypress(self, size, key)
|
return urwid.ListBox.keypress(self, size, key)
|
||||||
|
|
||||||
|
|
||||||
|
@ -294,6 +294,7 @@ class GridWalker(urwid.ListWalker):
|
|||||||
def set_focus(self, focus):
|
def set_focus(self, focus):
|
||||||
self.stop_edit()
|
self.stop_edit()
|
||||||
self.focus = focus
|
self.focus = focus
|
||||||
|
self._modified()
|
||||||
|
|
||||||
def get_next(self, pos):
|
def get_next(self, pos):
|
||||||
if pos+1 >= len(self.lst):
|
if pos+1 >= len(self.lst):
|
||||||
@ -414,6 +415,10 @@ class GridEditor(urwid.WidgetWrap):
|
|||||||
res.append(i[0])
|
res.append(i[0])
|
||||||
self.callback(self.data_out(res), *self.cb_args, **self.cb_kwargs)
|
self.callback(self.data_out(res), *self.cb_args, **self.cb_kwargs)
|
||||||
signals.pop_view_state.send(self)
|
signals.pop_view_state.send(self)
|
||||||
|
elif key == "G":
|
||||||
|
self.walker.set_focus(0)
|
||||||
|
elif key == "g":
|
||||||
|
self.walker.set_focus(len(self.walker.lst)-1)
|
||||||
elif key in ["h", "left"]:
|
elif key in ["h", "left"]:
|
||||||
self.walker.left()
|
self.walker.left()
|
||||||
elif key in ["l", "right"]:
|
elif key in ["l", "right"]:
|
||||||
@ -459,10 +464,10 @@ class GridEditor(urwid.WidgetWrap):
|
|||||||
("a", "add row after cursor"),
|
("a", "add row after cursor"),
|
||||||
("d", "delete row"),
|
("d", "delete row"),
|
||||||
("e", "spawn external editor on current field"),
|
("e", "spawn external editor on current field"),
|
||||||
("q", "return to flow view"),
|
("q", "save changes and exit editor"),
|
||||||
("r", "read value from file"),
|
("r", "read value from file"),
|
||||||
("R", "read unescaped value from file"),
|
("R", "read unescaped value from file"),
|
||||||
("esc", "return to flow view/exit field edit mode"),
|
("esc", "save changes and exit editor"),
|
||||||
("tab", "next field"),
|
("tab", "next field"),
|
||||||
("enter", "edit field"),
|
("enter", "edit field"),
|
||||||
]
|
]
|
||||||
|
@ -103,4 +103,8 @@ class HelpView(urwid.ListBox):
|
|||||||
return None
|
return None
|
||||||
elif key == "?":
|
elif key == "?":
|
||||||
key = None
|
key = None
|
||||||
|
elif key == "G":
|
||||||
|
self.set_focus(0)
|
||||||
|
elif key == "g":
|
||||||
|
self.set_focus(len(self.body.contents))
|
||||||
return urwid.ListBox.keypress(self, size, key)
|
return urwid.ListBox.keypress(self, size, key)
|
||||||
|
Loading…
Reference in New Issue
Block a user