When running a debug build we get an exception due to lacking this method and the documentation does seem to indicate this is required for scalar keys.
There doesn’t seem to be any replacement API for this so while the warning (when building with the 10.8 SDK) may serve as a reminder to update the code, the only possible update I can see is to drop support for reading text clippings.
The method wasn’t public before 10.10 but since we need to check for 10.10 we can simply conclude that lack of this method means that we are not running on 10.10.
The algorithm will avoid changing root when possible. If root has to be changed, we favor the current project folder, if that is not possible, we use the parent for the item being selected, unless the item is in a file package below the project folder, in that case, we use the root of the file package.
I’m seeing a few crashes where the most likely explanation is that input client methods are called either before setting up an editor instance, or after disposing it.
Crash is in CFStringGetLength called from _CFURLCreateWithFileSystemPath, so it appears that some sort of malformed string can find its way to this call.
Previously we only looked at the last caret, and if this one was not a selection then we would treat the multiple carets (selection ranges) as nothing being selected, and thus, a command replacing the carets, would not leave anything selected.
When pasting or using Filter Through Command with multiple carets, we ignore a potential final empty line, this is because our text will be something like “foo\nbar\n” and we split on the newline, so we end up with (“foo”, “bar”, “”) and if we have more than two carets, then we insert the empty string for every third caret.
For a command though we expect there is a 1:1 between number of carets and newlines in the result, so we should never skip the last element.
The problem is if we right-click an item that causes content to be changed (e.g. Show Enclosing Folder) then later in the same run loop cycle ask for selected items, we prefer the clicked row, but this one might now no longer exist.
The view passed to the file manager is used to request the undo manager. The problem with using an NSTableCellView instance is that this view may be taken out of the view hierarchy (and thus responder chain) which makes it lose its undo manager.
This isn’t an immediate problem but if we later use undo/redo, it might be.
This way we only have to abort editing if the item being edited is going away.
View-based table views do not supported editedRow so this commit also change the way to figure out if a row is being edited.
Previously if we deleted an expanded folder it would select the first child of this item which would then be removed and leave nothing selected.
There are still a few edge-cases left though where what’s selected after deleting items is not ideal.
We previously did this when the background style was set to dark, but the code for this only works when the view is a direct descendent of the NSTableCellView and also, when a row is selected in an inactive table view, the background style is not set to dark.