From 152814ea47fd99cfd55b2bff8585eddc4ce46505 Mon Sep 17 00:00:00 2001 From: deanishe Date: Tue, 17 Jun 2014 20:54:15 +0200 Subject: [PATCH] Fix editing of `settings.json` --- Sublime Text Projects.alfredworkflow | Bin 163090 -> 163114 bytes src/sublime.py | 9 ++++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/Sublime Text Projects.alfredworkflow b/Sublime Text Projects.alfredworkflow index 2e794afa6ee6a72f25e18ac6b4531cb3adc06a26..4f3b6ef0eccf038cf500d5b30272b0d38e4ae759 100644 GIT binary patch delta 2665 zcmZ9OX*|?>8^-_hXJ+iOWP4`FI`%DVmUNOqj@`+Ob;z21%M2RApk$4y6oXW!(AZLT zP9j?qQ%&SVNIFci$74KG=RBWJ&-3E<;=1nZzVF}t?pw6WeSep`z=-2g9;LygR|di? z-j|Vwr`lJz3}2x%p^nt5vn{%vEbP0LYM;Jm*Scp15vYJL$vn#tnIHB;hgPj+h%B5V zH;+<`I&!p?v<|UAuoDAjd3p?@5kr8e9%--~<6FEyoXvWF zMXm1Hx@Yci3&vJwr^iA;ceLNHPqi4y3R#7`u@89i+c&=u#_@yRynJ(3c}>r$dh)9H zfiSnW*w*?&uGa#0QCjviNUhOXIBQy}$fco{Iqaue+F&@~xQMKz)&hTQ%B=t`m(wHIsirA~0pFeJ#O^~kGw^N=As(-eWyiAc3 zbS=hE)wLW8?NH8XfwJgFu5PK)0%K#uuDuKeO~>I>S~sPXM@4MJx^(p{_sEP-;klDx z6f80QX>h4cf1jr|e~zfiIPqI@LNq>wguQW#_>B;gDSDiROQmbsGwTDdJd66)?uMT+ z`gO6vOo3l%c~DY5_08>j&a}sIGPw>z!qX$4PvjFXC1Uc3Jkp_#{GN)#Mx%#y72Uk$ z_frtEXE0q{R=MWRA&!v8If=)u72mH_`Nmo>`I9ggsk(#;-xzz{Dq_65X7g;{{L>|h zg_-@^7Ex^pKIcJqRe$SPk@luOa+py=SY`ElUkVki5J`J{Z1>mGU$g1j^Sa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Wj&OK(u+G*shc_;fulpq~`45dM7ah_fAG6^bFF0IWQ*UokZja@?YEf62KByfj z%}ad{at?dJ;7zH+sE&NZSWEW~)L-$(Ab;&7XUvR84{;>kr03c|^<~6#XO3~&vJgj! z9f`!yU2U1}7-;Y*a42u32cjl|kdULKm*g|;C1z$J+>9n}u}^00UN48Yt&I*!L{Qva z1yzN4xzF=HhL~@NBrk2;*=~Kfr`)V7>lpWXb2ME&}CGCV+2)IF)Dj< z0fV&05{(ycNRMQFjg?Y57RC!yYSeG6Jw;`dEv~V*A0I82!bz^fR`=_i4GFG^bF_nU zcC|Fj=Yw&Ke*X!8aGmUSx2_! zez0Zv(+fBNJT)2)BECyY%Uw7q1O-3XQQH;45vGNtDS_($Ty`jd=Ir2vT?<4VL~=53 zHMK#+cZ>1R2ABAmnT6HAUPM`e9cP%KRt%^KQthdwu^^l|ro@2Ae~m9=z*B#ZVpPdk z(1}^W#ey2&D}4ViKGfk@P!Xj6LxaUJq0ZD(aiG}u7gXOkPzDl6CC7pKOjyUaMga9q z94P%yLxcdzu+*r5)HyX!f{G%53bJ^nUlsF-$PV%Yz#p0b00YFC?gRi#ivlW0eAFz$ u|28nG{R9v$D{ln?Q8;{X02UX8{C@b;#@GOszkV!46^#e^piiPfCg;Cq?4soW diff --git a/src/sublime.py b/src/sublime.py index e76c6c9..a2035ae 100644 --- a/src/sublime.py +++ b/src/sublime.py @@ -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` @@ -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): @@ -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))