If you use APR, you trigger the command to reload manually whenever you’re ready; you need to be editing one of the files in the package, and that whole package will reload. This is handy for development purposes because you can make a few changes, and then make sure that everything reloads when you’re ready.
If you do it yourself in plugin code, then in order to get things to reload you need to save the root plugin file (in the example above that’s override_audit.py
) because the act of loading that file is what triggers it to reload things.
A reason to have your package do this would be that if you’re distributing your package via Package Control and you do an update, Package Control will set the package to be ignored (unloading the plugins in it), update it, and then un-ignore it. At this point the plugins will reload, but any of the modules that it contains will not, so you can end up with a mix of old and new code. Commonly in this case you would give advice somewhere that when the package updates you should restart Sublime, to make sure that everything is loaded.
This is the reason OverrideAudit does this in code, but I still use APR manually while developing it (and other packages) as well.