Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
sort_view_items PEP8
def sort_view_items(self):
cs = self.settings.case_sensitive
if self.settings.sort_by_file_name:
self.view_items.sort(key = lambda vi: (vi.name if cs else vi.name.lower(), vi.group, vi.tab))
elif self.settings.sort_by_folder:
self.view_items.sort(key = lambda vi: (vi.folder, vi.name if cs else vi.name.lower()))
elif self.settings.sort_by_syntax:
self.view_items.sort(key = lambda vi: (vi.syntax, vi.name if cs else vi.name.lower()))
elif self.settings.sort_by_indexes:
self.view_items.sort(key = lambda vi: (vi.group, vi.tab))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.