Since we treat a missing key as having the value ‘false’ there is no need to write out keys set to false. This was partly motivated by improving cached data since here we store non-strings as binary property lists, and boolean values are non-strings (not that we have that many keys set to false, but it would e.g. happen if user disable an item and later enable it).
For example if the user makes a change and later reverts it (in the bundle editor) there should no longer be a local (delta) item saved. Though the containing delta bundle remains (but ideally that should be removed as well).
This would cause deleted (delta) items to show up in the bundle editor (as it queries the bundle manager for disabled items and would thus also get the deleted ones).
This will apply to all items in the bundle so it’s questionable if it’s something we want to use, as it would not allow the user to run a “Help” command from the bundle without first setting up the requirements. OTOH setting requiredCommands for all but a few items in e.g. the Git bundle seems redundant — perhaps items should be able to eclipse keys from the bundle’s info.plist to effectively unset the requiredCommands for a select few items.
The variable provided was ignored meaning that it would only work correctly if the executable was found via PATH, and if it wasn’t found, the error message would display a bogus character as the variable that the user should set.
Generally we should always provide a base environment, since the scoped variables are format strings. The filtering scope selector is however optional, and we do not have one when executing commands outside an fi;e/editor context.
These are now all prefixed with what they are obtaining variables for (scope, document, bundle, …) which makes it easier to analyze/refactor the code.
Also change document_t’s settings function to document_settings.
We previously used a dictionary so that initializing a bundle item object wouldn’t need to know the difference between a full property list and a cached subset. Technically though the previous code had an implicit assertion on the bundle item not being able to rely on the settings values being useful, which is now gone.
The main advantage though is a smaller and more correct cache format.
Effectively it doesn’t change much as cached items are fetched with a file date, but in theory it should now be possible to omit that date (if we can trust that fs-events has always notified us about disk changes).
Since it’s not unlikely that a user will downgrade from a nightly build, we should be prepared to see cache files using a newer (incompatible) file format.
Recording that an item is deleted in the bundle’s info.plist is necessary for TextMate 1.x because it merges all installed bundles, so if the user has a local version, he will still see items from the default version, unless these are indicated to be deleted in the local version.
With 2.0 only delta bundles get merged with a less-local bundle, and when deleting a default item, a delta item is written with the ‘isDeleted’ key set to true.
Using instances with static storage in Objective-C files result in the following warning (starting with clang 425.0.24):
ld: warning: direct access in […] to global weak symbol […] means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
There is a minor functional change in that the custom callback type uses event loop signaling that makes it safe to trigger the callback from a thread. This should however not be necessary for timers (which are all setup on the main thread).