Browse Source

feat: add ability to use custom active project indicator

master
acheronfail 4 years ago
parent
commit
c4b72c9d7b
  1. 27
      project_manager.py
  2. 7
      project_manager.sublime-settings

27
project_manager.py

@ -54,19 +54,6 @@ def pretty_path(path):
return path
def render_display_item(item):
project_name, info = item
if "star" in info:
display_name = project_name + "*"
else:
display_name = project_name
return [
project_name,
display_name,
pretty_path(info['folder']),
pretty_path(info['file'])]
def itemgetter(*index):
"""
A version of itemgetter returning a list
@ -209,8 +196,20 @@ class Manager:
return pdir
return None
def render_display_item(self, item):
project_name, info = item
if "star" in info:
display_name = project_name + str(self.settings.get('active_project_indicator', '*'))
else:
display_name = project_name
return [
project_name,
display_name,
pretty_path(info['folder']),
pretty_path(info['file'])]
def display_projects(self):
plist = list(map(render_display_item, self.projects_info.items()))
plist = list(map(self.render_display_item, self.projects_info.items()))
plist.sort(key=lambda p: p[0])
if self.settings.get('show_recent_projects_first', True):
self.move_recent_projects_to_top(plist)

7
project_manager.sublime-settings

@ -8,7 +8,10 @@
// It would be useful if Sublime Text settings are synced across different computers.
"use_local_projects_dir":false,
// show recent projects first
// Show recent projects first
// if false, the projects are sorted alphabetically
"show_recent_projects_first":true
"show_recent_projects_first":true,
// The string to append to indicate an active project.
"active_project_indicator": "*"
}

Loading…
Cancel
Save