Home Download Buy Blog Forum Support

ST3 EditPreferences

ST3 EditPreferences

Postby sublimator on Thu Jan 31, 2013 11:44 am

Initial port of EditPreferences to ST3

[
{
"caption": "Edit Preference: List Settings", "command": "list_settings"},
{
"caption": "Edit Preference: List Plugins Commands", "command": "list_commands" },
{
"caption": "Edit Preference: List Shortcut Keys", "command": "list_shortcut_keys"},


{
"caption": "Edit Preference: Theme",
"command": "edit_package_files",
"args": {"pref_type": "sublime-theme"}},

{
"caption": "Edit Preference: sublime-completions",
"command": "edit_package_files",
"args": {"pref_type": "sublime-completions"}},

{
"caption": "Edit Preference: sublime-build",
"command": "edit_package_files",
"args": {"pref_type": "sublime-build"}},

{
"caption": "Edit Preference: sublime-mousemap",
"command": "edit_package_files",
"args": {"pref_type": "sublime-mousemap"}},

{
"caption": "Edit Preference: sublime-menu",
"command": "edit_package_files",
"args": {"pref_type": "sublime-menu"}},

{
"caption": "Edit Preference: tmTheme|colorscheme",
"command": "edit_package_files",
"args": {"pref_type": ".*\\.(tmTheme|stTheme)$"}},

{
"caption": "Edit Preference: tmLanguage|syntax|grammar",
"command": "edit_package_files",
"args": {"pref_type": ".*\\.((tm|st)Language)$"}},

{
"caption": "Edit Preference: sublime-commands",
"command": "edit_package_files",
"args": {"pref_type": "sublime-commands"}}

// COMMANDS THAT HAVENT BEEN PORTED TO ST3 YET
// { "caption": "Edit Preference: List Menus", "command": "list_menu_bindings"}
]


MRF

Update (Sat 02 Feb 2013 04:57:54 PM ) : Added a dodgy generator based filter to strip comments and trailing commas as allowed by sublime json variant

Update (Fri 01 Feb 12:00:25 PM ) : A fix for `list_commands` to properly get the package name
Update (Fri 01 Feb 2013 12:00:25 PM ) : Initial, part featured, port of edit_package_files commands to ST3
Update (Thu 31 Jan 2013 07:01:05 PM ) : Fixed windows path related bugs
Update (Thu 31 Jan 2013 06:22:02 PM) : Added `list_shortcut_keys` back in.
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3 EditPreferences

Postby sublimator on Fri Feb 01, 2013 4:37 am

Image
Image
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3 EditPreferences

Postby sublimator on Sat Feb 02, 2013 4:32 am

If anyone is bored and wants to contribute to this, a simple processor (don't think simple regex would work) that strips out comments and trailing commas would be sweet.
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3 EditPreferences

Postby facelessuser on Sat Feb 02, 2013 5:35 am

For stripping comments and trailing commas from JSON? I already have that https://github.com/facelessuser/PlistJs ... file_strip

I do it simply by feeding the content through this:

Code: Select all
j = sanitize_json(content)


Feel free to use it if you like.

Edit: Probably not Python 3 compatible yet, but I imagine it could easily be brought into compliance.
facelessuser
 
Posts: 1563
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3 EditPreferences

Postby sublimator on Sat Feb 02, 2013 6:01 am

Beauty, how does it strip?

I need it to replace any stripped characters with spaces so as to keep the character indexes correct for navigation

At a glance it doesn't seem to?
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3 EditPreferences

Postby sublimator on Sat Feb 02, 2013 10:21 am

Wrote a shitty generator based one, with a conditional tree that seems to mirror the something about something. Seems to work ... ?

Meanwhile in Cambodia:
So you got a headache? How bout we scratch the shit out of your chest then stick 62 suction cups on your back a few times?
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3 EditPreferences

Postby sublimator on Sat Feb 02, 2013 11:06 am

Spewing, the matching doesn't really work with the `soft` columns any more

Worked a lot nicer in ST2

The results are just misleading now if you aren't paying careful attention
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3 EditPreferences

Postby facelessuser on Sat Feb 02, 2013 2:41 pm

castles_made_of_sand wrote:Beauty, how does it strip?

I need it to replace any stripped characters with spaces so as to keep the character indexes correct for navigation

At a glance it doesn't seem to?


Never needed to preserve columns with spaces. Lines is about all I ever needed to preserve. At work I use something similar to this in tools when I need to search for things in C source code and avoid false positives found in comments. Usually I just need to know what line the target is found on, not column. I am sure it could easily be adapted to replace with spaces instead, but it appears you have moved on anyways with a new approach.
facelessuser
 
Posts: 1563
Joined: Tue Apr 05, 2011 7:38 pm

Re: ST3 EditPreferences

Postby sublimator on Sun Feb 03, 2013 1:19 am

facelessuser wrote:appears you have moved on anyways with a new approach


I waited a bit for you to swoop in with the change :) The regex were too scary at a glace for me to try myself.
It is better to remain silent and be thought a fool, than to speak out and remove all doubt
sublimator
 
Posts: 649
Joined: Thu Mar 20, 2008 5:41 am

Re: ST3 EditPreferences

Postby facelessuser on Sun Feb 03, 2013 3:21 am

Yeah, I've been moving a bit slow recently :-).
facelessuser
 
Posts: 1563
Joined: Tue Apr 05, 2011 7:38 pm

Next

Return to Plugin Announcements

Who is online

Users browsing this forum: Alexa [Bot] and 13 guests