From b46461bc073156dac3b808a6c9e606ed2844a92c Mon Sep 17 00:00:00 2001 From: Holger Rapp Date: Sun, 17 Jul 2011 12:09:29 +0200 Subject: [PATCH] Sort snippets alphabetically before showing them in the list. Patch by Allait --- plugin/UltiSnips/__init__.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/plugin/UltiSnips/__init__.py b/plugin/UltiSnips/__init__.py index 898c918..66e5e3d 100644 --- a/plugin/UltiSnips/__init__.py +++ b/plugin/UltiSnips/__init__.py @@ -667,6 +667,9 @@ class SnippetManager(object): before, after = self._get_before_after() snippets = self._snips(before, True) + # Sort snippets alphabetically + snippets.sort(key=lambda x: x.trigger) + if not snippets: return True