Based on crash reports received it might be that this function is sometimes called without a window, although the call-sites all do pass a window to the function.
The button will show “Replace Selected” if either not all results are selected
or when all results are selected, replacement has been done for only some of the files with matches.
Validation of the Check/Uncheck All menu items has also been improved.
It does seem redundant with four counters for the FFResultNode but this is required for efficient bindings since the state of the “Replace All / Selected” button depend on all these things.
At the same time the semantics have been simplified so that the ‘readOnly’ property (formerly ‘ignored’) does not have any side effects with respect to whether or not the item is excluded.
The only thing special is that when a node is set to be read-only, a change of its ‘exclude’ property will not be forwarded to its children.
This is intentionally kept very similar to document_t so that we can make document_t a wrapper and once all document_t code has been migrated to OakDocument, we can extend the API like introducing an OakDocumentEditor and possibly make it an NSDocument subclass.
The implementation of OakDocument have some minor improvements over document_t for example when a document is changed on disk we delay reloading the changes until TextMate is made active, and we currently do not reload the content when there are merge conflicts (though we need to warn the user about this).
Minimum OS requirement is now OS X 10.8 because we use NSUUID.
None of the hooks actually use this data and as they are called after the replacement has been done, they can query the buffer, should they require information about its content.
The problem with having to pass the data pointer to the hooks is that there could be future situations in where the buffer’s data is not inserted as one contiguous block of memory, for example we could allow constructing a buffer from a storage_t instance.
If we find that the user doesn’t have any BOM versions enabled but do have the non-BOM versions then we update their settings to instead use the BOM versions.