Skip to content

Commit

Permalink
Updated core plugin
Browse files Browse the repository at this point in the history
Added alphabetical sorting of the lists used in the "insert noun here"
commands. So the entries in the menu are now sorted alphabetically.
  • Loading branch information
Kapiainen committed Feb 25, 2015
1 parent a285f5a commit eeaedba
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Core/SublimePapyrus.py
Original file line number Diff line number Diff line change
Expand Up @@ -330,8 +330,11 @@ def run(self, edit, **args):
self.argument = region
items = self.get_items()
if items != None:
self.items = list(items.keys())
self.values = list(items.values())
sortedKeysAndValues = sorted(zip(list(items.keys()), list(items.values())))
sortedKeys = [key for (key, value) in sortedKeysAndValues]
sortedValues = [value for (key, value) in sortedKeysAndValues]
self.items = sortedKeys
self.values = sortedValues
if PYTHON_VERSION[0] == 2:
self.view.window().show_quick_panel(self.items, self.on_select, 0)
elif PYTHON_VERSION[0] == 3:
Expand Down

0 comments on commit eeaedba

Please sign in to comment.