If our buffer contained such sequences then an exception could be thrown when creating an NSString representation, for example copying to the system clipboard or displaying search results in the UI.
The problem with the latter is that a C string is null terminated, but we might have null characters in our string.
Furthermore, the stringWithCxxString: can do a little extra work, like check if the string is NULL_STR or (after next commit) fix redundantly encoded multi-byte sequences.
We only use the last empty line when there are more than a single line break in the string to be inserted.
The use-case here is having multiple carets and then running a command like “echo foo”. Here we receive “foo\n” which is split into (“foo”, “”), so every second caret would get the empty string inserted.
With the boost thread helper we have to statically link to the boost libraries, which on most system is built against the latest version of the OS (instead of our current target 10.7). This doesn't seem to be an actual problem, but newer versions of clang issue warnings about it.
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.