From c8c56da8799c25e787bcdcd1fdd7bdc33db6d204 Mon Sep 17 00:00:00 2001 From: Mason Larobina Date: Wed, 25 Nov 2009 09:28:15 +0800 Subject: Show the completion list before completing when partial in hints list. --- examples/data/uzbl/plugins/completion.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'examples/data/uzbl/plugins') diff --git a/examples/data/uzbl/plugins/completion.py b/examples/data/uzbl/plugins/completion.py index cfdf901..42e7e17 100644 --- a/examples/data/uzbl/plugins/completion.py +++ b/examples/data/uzbl/plugins/completion.py @@ -9,7 +9,7 @@ import re UZBLS = {} # Completion level -NONE, ONCE, LIST = range(3) +NONE, ONCE, LIST, COMPLETE = range(4) # Default instance dict. DEFAULTS = {'completions': [], 'level': NONE, 'lock': False} @@ -97,7 +97,7 @@ def update_completion_list(uzbl, *args): return stop_completion(uzbl) d = get_completion_dict(uzbl) - if d['level'] != LIST: + if d['level'] < LIST: return hints = [h for h in d['completions'] if h.startswith(partial)] @@ -119,7 +119,7 @@ def start_completion(uzbl, *args): if not partial: return stop_completion(uzbl) - if d['level'] < LIST: + if d['level'] < COMPLETE: d['level'] += 1 hints = [h for h in d['completions'] if h.startswith(partial)] @@ -132,7 +132,7 @@ def start_completion(uzbl, *args): d['lock'] = False return - elif partial in hints: + elif partial in hints and d['level'] == COMPLETE: d['lock'] = True complete_completion(uzbl, partial, partial, set_completion) d['lock'] = False -- cgit v1.2.3