These changes are mostly aesthetic in nature. I just thought it would
be a good idea to have theme loading be parallel to package loading as
much as possible. So I localized more logic on the `atom` global.
There's a slight wrinkle in this commit… TextMate grammars sometimes store
the `foldStopMarker` directly in the grammar, rather than storing it
in a separate scoped preferences file like the other settings. So we
have to scan through grammars looking for those that have the fold end
marker and make a scoped property for that grammar's scope.
This corrects a regression when pattern matching
to the newline was added.
If the newline is never matched the loop still needs to
terminated so now when the position is before the newline
and the last match had no tokens the loop is broken out of.
This makes the scoped property system mimic the behavior of CSS. When
there is a tie, the scoped properties loaded later in the cascade win.
I also optimize the scanning of all the properties, checking only those
sets of properties that have a value for the desired key path, to reduce
the need to match a ton of scope selectors.
We'll store all syntax-related global state in the `syntax` global. For
now, this means that all scoped properties will be stored here, as well
as all grammars.
Previously no gutter highlight was displayed unless
the selection was empty.
Now there is a separate CSS class for no selection
that changes the background color independently
from the foreground color.
You can pass a scope stack when calling `config.get`, which will prefer
settings under the most specific matching scope selector for the given
scope stack.
This simplifies the loading of TextMate bundles in the spec and benchmark helpers. Since `loadBundle` was already implemented on `atom`, it made sense to move this logic here. Config is now more focused on its core job of handling configuration, not loading bundles.
When a command returned a large amount of data, it was blocking on the stderr callback when `[fileHandle availableData]` was called. From what I can tell, this is because stderr was being called with a zero-length string.
This was fixed when `[fileHandle availableData]` was moved to run inside the NSTask thread (instead of on the main thread). It now returns a zero-length string rather than blocking forever.
An unresolved question is why stderr is being called with zero-length strings.
The goal is that `loadPackage` will be the go-to place for loading all kinds of resources out of directories. `requireExtension` was only designed to load and activate extension modules.
The `config` object no longer stores config properties directly. Instead it stores them on an internal `settings` object, which makes it easier to serialize settings without getting them mixed up with non-setting state on the `config` object.