From 1ebdda79029a66330983648326e2eef883415e03 Mon Sep 17 00:00:00 2001 From: jlhonora Date: Wed, 8 Jul 2015 12:10:03 -0300 Subject: [PATCH] Match g/G shortcuts to less, fix #631 --- libmproxy/console/flowlist.py | 8 ++++---- libmproxy/console/grideditor.py | 4 ++-- libmproxy/console/help.py | 6 +++--- libmproxy/console/searchable.py | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/libmproxy/console/flowlist.py b/libmproxy/console/flowlist.py index bb23df75a..46cd0de12 100644 --- a/libmproxy/console/flowlist.py +++ b/libmproxy/console/flowlist.py @@ -50,9 +50,9 @@ class EventListBox(urwid.ListBox): self.master.clear_events() key = None elif key == "G": - self.set_focus(0) - elif key == "g": self.set_focus(len(self.master.eventlist) - 1) + elif key == "g": + self.set_focus(0) return urwid.ListBox.keypress(self, size, key) @@ -338,10 +338,10 @@ class FlowListBox(urwid.ListBox): self.master.clear_flows() elif key == "e": self.master.toggle_eventlog() - elif key == "G": + elif key == "g": self.master.state.set_focus(0) signals.flowlist_change.send(self) - elif key == "g": + elif key == "G": self.master.state.set_focus(self.master.state.flow_count()) signals.flowlist_change.send(self) elif key == "l": diff --git a/libmproxy/console/grideditor.py b/libmproxy/console/grideditor.py index b20e54e49..c93ecabfa 100644 --- a/libmproxy/console/grideditor.py +++ b/libmproxy/console/grideditor.py @@ -416,9 +416,9 @@ class GridEditor(urwid.WidgetWrap): res.append(i[0]) self.callback(self.data_out(res), *self.cb_args, **self.cb_kwargs) signals.pop_view_state.send(self) - elif key == "G": - self.walker.set_focus(0) 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"]: self.walker.left() diff --git a/libmproxy/console/help.py b/libmproxy/console/help.py index 5a63cb105..ba87348de 100644 --- a/libmproxy/console/help.py +++ b/libmproxy/console/help.py @@ -28,7 +28,7 @@ class HelpView(urwid.ListBox): keys = [ ("j, k", "down, up"), ("h, l", "left, right (in some contexts)"), - ("g, G", "go to end, beginning"), + ("g, G", "go to beginning, end"), ("space", "page down"), ("pg up/down", "page up/down"), ("arrows", "up, down, left, right"), @@ -108,8 +108,8 @@ class HelpView(urwid.ListBox): return None elif key == "?": key = None - elif key == "G": - self.set_focus(0) elif key == "g": + self.set_focus(0) + elif key == "G": self.set_focus(len(self.body.contents)) return urwid.ListBox.keypress(self, size, key) diff --git a/libmproxy/console/searchable.py b/libmproxy/console/searchable.py index 627d595d9..dea0ac7fc 100644 --- a/libmproxy/console/searchable.py +++ b/libmproxy/console/searchable.py @@ -33,10 +33,10 @@ class Searchable(urwid.ListBox): self.find_next(False) elif key == "N": self.find_next(True) - elif key == "G": + elif key == "g": self.set_focus(0) self.walker._modified() - elif key == "g": + elif key == "G": self.set_focus(len(self.walker) - 1) self.walker._modified() else: