aboutsummaryrefslogtreecommitdiffstats
path: root/libmproxy
diff options
context:
space:
mode:
authorAldo Cortesi <aldo@nullcube.com>2012-03-19 10:57:27 +1300
committerAldo Cortesi <aldo@nullcube.com>2012-03-19 10:57:27 +1300
commit50630d62fd51ff8d73b44bb8c5d317d3de2a283d (patch)
tree50442a317039f089af485eea117fbea6bbe8237a /libmproxy
parent0de97ad9e0bfc319d36d4eadbcb77e786120d011 (diff)
downloadmitmproxy-50630d62fd51ff8d73b44bb8c5d317d3de2a283d.tar.gz
mitmproxy-50630d62fd51ff8d73b44bb8c5d317d3de2a283d.tar.bz2
mitmproxy-50630d62fd51ff8d73b44bb8c5d317d3de2a283d.zip
Grid editor refinements.
- Correct column width calculation used in keystrokes. Arrow keys should now work as expected in multi-line fields. - Enable multi-line editing throughout. You now need to tab or esc to exit edit mode.
Diffstat (limited to 'libmproxy')
-rw-r--r--libmproxy/console/grideditor.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/libmproxy/console/grideditor.py b/libmproxy/console/grideditor.py
index 2221fa11..28d2cc1d 100644
--- a/libmproxy/console/grideditor.py
+++ b/libmproxy/console/grideditor.py
@@ -95,7 +95,8 @@ class GridItem(common.WWrap):
def keypress(self, s, k):
if self.editing:
- k = self.editing.keypress((s[0]-self.first_width-4,), k)
+ w = self.w.column_widths(s)[self.focused]
+ k = self.editing.keypress((w,), k)
return k
def selectable(self):
@@ -253,7 +254,7 @@ class GridEditor(common.WWrap):
def keypress(self, size, key):
if self.walker.editing:
- if key in ["esc", "enter"]:
+ if key in ["esc"]:
self.walker.stop_edit()
elif key == "tab":
pf, pfc = self.walker.focus, self.walker.focus_col