return snippets in original order

This commit is contained in:
rygwdn@gmail.com 2011-05-02 14:28:10 -03:00
parent a2ee197c1f
commit 5d208cb7be

View File

@ -949,7 +949,9 @@ class SnippetManager(object):
snippets[s.trigger].append(s)
# Transform dictionary into flat list of snippets
snippets = [item for sublist in snippets.values() for item in sublist]
selected_snippets = set([item for sublist in snippets.values() for item in sublist])
# Return snippets to their original order
snippets = [snip for snip in found_snippets if snip in selected_snippets]
return snippets