From 5d208cb7be55665cbcd56593017bec96c7bb5baa Mon Sep 17 00:00:00 2001 From: "rygwdn@gmail.com" <> Date: Mon, 2 May 2011 14:28:10 -0300 Subject: [PATCH] return snippets in original order --- plugin/UltiSnips/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/plugin/UltiSnips/__init__.py b/plugin/UltiSnips/__init__.py index e535570..f4d15a4 100644 --- a/plugin/UltiSnips/__init__.py +++ b/plugin/UltiSnips/__init__.py @@ -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