ignore duplicates of completion outputs, #97

This commit is contained in:
David Halter committed 2012-12-29 01:59:34 +01:00
1 parent b04e74ca7d
commit 406233b62d
3 files changed
+15 -1

No files matched your search

+7 -1
View File
@@ -146,6 +146,7 @@ class Script(object):
needs_dot = not dot and path
comps = []
comp_dct = {}
for c, s in set(completions):
n = c.names[-1]
if settings.case_insensitive_completion \
@@ -155,7 +156,12 @@ class Script(object):
self._parser.user_stmt, n):
new = api_classes.Completion(c, needs_dot,
len(like), s)
comps.append(new)
n = new.complete
if n in comp_dct and not settings.no_completion_duplicates:
comp_dct[n].same_name_completions.append(new)
else:
comp_dct[n] = new
comps.append(new)
debug.speed('complete end')