summaryrefslogtreecommitdiff
path: root/interface
diff options
context:
space:
mode:
Diffstat (limited to 'interface')
-rwxr-xr-xinterface/input/tabcomp.py15
-rw-r--r--interface/interface.py11
2 files changed, 22 insertions, 4 deletions
diff --git a/interface/input/tabcomp.py b/interface/input/tabcomp.py
index 7479f97..c454ad2 100755
--- a/interface/input/tabcomp.py
+++ b/interface/input/tabcomp.py
@@ -61,6 +61,13 @@ class Input:
start = {}
for i, f in ctx:
+ if not i:
+ if None in parent.children:
+ raise ValueError("Duplicate base command")
+ parent.children.append(None)
+ parent.f = f
+ continue
+
if isinstance(i, str):
i = i.split(' ')
if i[0] not in start:
@@ -180,16 +187,20 @@ class Input:
## In the format:
## (input, parsed, display, is variable?)
path = [["", True, "", False]]
+ size_ok = True
while True:
with self._ctx_lock:
self._l1 = "".join((i[2] for i in path if i[2]))
with CURSES_LOCK:
- self._redraw()
+ if size_ok:
+ self._redraw()
l = self.win.getch()
with self._ctx_lock:
if l == curses.KEY_RESIZE:
if resize is not None:
- resize()
+ size_ok = resize()
+ continue
+ if not size_ok:
continue
if self._context is None:
continue
diff --git a/interface/interface.py b/interface/interface.py
index 3572bbe..0586f16 100644
--- a/interface/interface.py
+++ b/interface/interface.py
@@ -60,8 +60,14 @@ class Interface:
def _resize(self):
## FIXME
- self._actual_resize()
- self._actual_resize()
+ try:
+ self._actual_resize()
+ self._actual_resize()
+ except:
+ self.stdscr.addstr(0, 0, "Too small")
+ self.stdscr.refresh()
+ return False
+ return True
def _actual_resize(self):
for (a1, a2), (f1, f2) in zip(self._compute_sizes(*self.stdscr.getmaxyx()), ((self.channel_bank.set_dim, self.channel_bank.set_pos), (self.input.set_dim, self.input.set_pos), (self.pager.set_dim, self.pager.set_pos), *((c.set_dim, c.set_pos) for c in self.chaser_views))):
@@ -938,6 +944,7 @@ class Interface:
("advance $num", lambda n: self.run_jump(n, None, False)),
("advance", lambda: self.run_jump(0, None, True)),
("badvance", lambda: self.run_jump(1, None, True)),
+ ("", lambda: self.run_jump(0, None, True)),
("everythingadvance", self.run_advance_all),