Home Download Buy Blog Forum Support

Can I remove an override in a package (i.e. restore default)

Can I remove an override in a package (i.e. restore default)

Postby bvm42 on Mon Jul 29, 2013 7:54 am

I can see there are many ways to override built-in behaviors. But what happens if a package adds an override that I don't want? I'm thinking specifically of SublimeJedi, which steals ctrl+button1, which has the very important built-in behavior of adding a selection. Obviously, I can edit the package's Default.sublime-mousemap and remove the offending override, but then I have to do this every time the package updates. Seems like I need to write my own Default.sublime-mousemap in Packages/User to override the override. What should it say? I can't find any documentation for mousemap. And ST3 lets me view the default keymap, but not the default mousemap.

(It occurs to me that this particular case might be a bug in SublimeJedi. The mousemap I'm referring to reads

Code: Select all
    {
        "modifiers": ["ctrl"], "button": "button1",
        "command": "sublime_jedi_goto",
        "press_command": "drag_select"
    }

which seems like it might be trying to say what to do about drag selections, but it's not saying it right?)
bvm42
 
Posts: 3
Joined: Mon Jul 29, 2013 7:22 am

Re: Can I remove an override in a package (i.e. restore default)

Postby skuroda on Tue Jul 30, 2013 2:34 am

Yes you can likely override the file (as it's supported in ST3), but creating a "Default (<OS>).sublime-mousemap" is probably a better solution. You can see the default values in the Default folder. To view the defaults, without having to manually extract, take a look at PackageResourceViewer.
skuroda
 
Posts: 677
Joined: Fri Oct 05, 2012 8:11 am

Re: Can I remove an override in a package (i.e. restore default)

Postby bvm42 on Tue Jul 30, 2013 7:02 am

Thanks. Creating my own sublime-mousemap does solve this particular problem. (The defaults, by the way, are in C:\Program Files\Sublime Text 3\Packages\Default.sublime-package in ST3.)

Still, it would be nice if mousemap and keymap files had some sort of magic value, say "use-default-behavior": true, to remove any package overrides.
bvm42
 
Posts: 3
Joined: Mon Jul 29, 2013 7:22 am


Return to General Discussion

Who is online

Users browsing this forum: macjohnmcc and 32 guests