Skip to content

Commit

Permalink
Fix editing of settings.json
Browse files Browse the repository at this point in the history
  • Loading branch information
deanishe committed Jun 17, 2014
1 parent d8d4a71 commit 152814e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Binary file modified Sublime Text Projects.alfredworkflow
Binary file not shown.
9 changes: 8 additions & 1 deletion src/sublime.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,11 @@
log = None


def do_edit_config(wf):
"""Open `settings.json` in default editor"""
subprocess.call(['open', wf.settings_path])


def do_update(wf):
"""Delete cached results to force update on next call"""
# Force reloading of results from `locate`
Expand All @@ -61,7 +66,7 @@ def do_config(wf):
wf.add_item('Edit Configuration',
'Open `settings.json` in your default editor.',
valid=True,
arg=wf.settings_path,
arg='edit',
icon=ICON_SETTINGS)

if not os.path.exists(LOCATE_DB):
Expand Down Expand Up @@ -133,6 +138,8 @@ def main(wf):
return do_help(wf)
elif args.action == 'update':
return do_update(wf)
elif args.action == 'edit':
return do_edit_config(wf)
else:
raise ValueError('Unknown action : {}'.format(args.action))

Expand Down

0 comments on commit 152814e

Please sign in to comment.