From 50630d62fd51ff8d73b44bb8c5d317d3de2a283d Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Mon, 19 Mar 2012 10:57:27 +1300 Subject: 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. --- libmproxy/console/grideditor.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'libmproxy') 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 -- cgit v1.2.3