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.
Apart from being simpler to use this wrapper supports adding ‘//BOM’ to the charset name to either consume or produce a byte order marker.
It also converts invalid byte sequences to (ASCII) escape codes, e.g. \x8F.
This suppresses the below warning when compiling xibs with Xcode 7 or later.
warning: This file is set to build for a version older than the deployment target. Functionality may be limited. [9]
We should revisit this when we update our minimum deployment target to 10.8 or higher, as it may not be needed.
This was previously placed in the file browser’s action menu and thus probably overlooked by many, even though ⇧⌘A is a very useful key equivalent, since many commands work on the entire project when there is no selection in the file browser.
Majority of the time in the main thread was spent updating the countOfLeafs property since canReplaceAll and the result text are dependent on this property.
Unfortunately disabling the “Delete” button is cumbersome because our history is stored with CoreData so knowing the number of items in the history requires a fetch request, which we would not know when to re-run (to update the disabled state when the history is changed).
When the filter string is empty we can use the array controller’s results, but I’m leaving that for the future.
Technically we are unable to delete the pasteboard’s current item so “Clear All” was performing a “Clear All Minus One”. While the new label does not make this clear, it at least does not promise to clear everything.
This serves to make the code slightly more abstract and allows the document to optimize the comparison operator, e.g. testing pointer equivalence before involving more complex checks.