This improves the chance that someone googling for a certain accessibility
attribute or other accessibility constant in order to find inspiration how to
implement it will find our code in OakTextView. It also makes the code more
understandable for reading by someone else, and generally follows the way
others write accessibility code (including Apple in their code samples). It
does make the code more verbose, but I think that does not outweight the above
advantages.
Inspired by: googling and "githubbing" for NSAccessibilityLinkTextAttribute:
http://lists.apple.com/archives/accessibility-dev/2014/Aug/msg00016.html
This is for the “untitled save path” which is normally used for new untitled files, so we wouldn’t actually have a folder, however, the property is also used as a fallback for a “project folder” when that property is unset (which it generally shouldn’t be).
Prior to this commit the ‘searchDuration’ property would actually return seconds since we last started a search, rather than how long the last search took.
We now collapse if more than half the items are expanded, otherwise expand. Previously we relied on a property to track the collapsed/expanded state, which could be out of sync if the user manually changed the state for half the items, and we also needed to reset the state variables when updating search results.
Previously these were created on demand, but that meant loading the document in the UI thread. It also meant that multiple matches from same document would cause the document to be read for multiple times.
Furthermore, storing the match excerpt with the find::match_t type should allow for more flexibility, since we no longer need special logic in the table view delegate to load a subset of a document to get the display string, but will simply read it from the record.
A warning will be written to stderr when this happens. The user can provide -e/--preserve-escapes to disable the behavior.
Use -e0/--preserve-escapes=0 to suppress the warning.
Having an initial title that is different from what the user will see makes it harder for them to change the key equivalent, since they most know what this initial title is.
For more info see http://lists.macromates.com/textmate/2014-January/036949.html
When opening a folder we test against the ‘projectPath’ property (on already open window controllers), but this is not setup until we have an open document, and documents are opened using a background queue, so code running in the same event loop cycle as the session restore, will not get the proper value for this property.
The problem this fixes is: open /path/to/foo and quit TextMate. Now drag /path/to/foo to TextMate’s app icon. TextMate would first restore session (which includes /path/to/foo) and then open /path/to/foo (not seeing the restored folder as being /path/to/foo due to the uninitialized ‘projectPath’ property).