Fix a crash and some sizing issues in KVEditor.

Mostly arising when editing an empty header set.
This commit is contained in:
Aldo Cortesi
2012-02-08 23:42:56 +13:00
parent 205d2ad577
commit 46c5982d3d

View File

@@ -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