From 46c5982d3da0355f458ceea2077230fbed9c289b Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 8 Feb 2012 23:42:56 +1300 Subject: Fix a crash and some sizing issues in KVEditor. Mostly arising when editing an empty header set. --- libmproxy/console/kveditor.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libmproxy/console/kveditor.py b/libmproxy/console/kveditor.py index 632a6992..e74895bb 100644 --- a/libmproxy/console/kveditor.py +++ b/libmproxy/console/kveditor.py @@ -90,7 +90,9 @@ class KVItem(common.WWrap): class KVWalker(urwid.ListWalker): def __init__(self, lst): self.lst = lst - self.maxk = max(len(v[0]) for v in lst) + self.maxk = max(len(v[0]) for v in lst) if lst else 20 + if self.maxk < 20: + self.maxk = 20 self.focus = 0 self.focus_col = 0 self.editing = False -- cgit v1.2.3