When all paths had the same prefix as first item, the first item would be returned as the common ancestor even if the other paths were not children.
For example:
/path/to/some_folder
/path/to/some_folder_with_same_prefix
Here `/path/to/some_folder` was returned even though `/path/to` is the common ancestor.
The function is still not correct when all paths are actual descendants of first path, but since it’s only used for display purposes, and with “find in folder” (where paths shouldn’t overlap), I am not bothering with that issue.
Previously this database was loaded each time a file of unknown encoding was read, which could add a significant overhead when using “find in folder” with a large database and many files with unknown encoding.
The reason is that menuForEvent: will draw an outline around the items under the mouse, which can be incorrect when we use the keyboard.
While we can address it by creating a fake mouse event that points to the selection, this will fail when there is no selection, so I felt it was better to always forego it.
Comment also added to the source (since this workaround is not optimal, and I would like to find the correct solution):
If we use `self.size` for the off-screen image buffer then we get a scaled up 16×16 image in the file chooser (⌘T).
My theory is that when drawing the image, the image size is 16×16 but the graphics context uses a transformation so that each point is multiple pixels, which our off-screen image does not replicate.
I do not know how to get the actual “pixel size” of the destination, so using the largest image is a workaround and knowing the actual size could give a better result.
- number: Show number with thousand separators, e.g. “32,351”
- relative: Show dates as relative to now, e.g. “3 minutes ago”
- duration: Show numbers as duration in seconds, e.g. “1 hour, 7 minutes”.
- dirname: Show all but last path component
- basename: Show last path component
- urlescape: Encode characters that are not valid to include in URLs
- shellescape: Wrap problematic strings in single quotes and/or escape single quote characters
There were two issues:
1. The window’s sheetParent property is cleared when sending orderOut: to the window so the NSModalResponse was never passed on, as we were sending it to nil.
2. The endSheet:returnCode: was using NSModalResponseCancel but the completion handler was actually testing for NSModalResponseAbort
We were already using the triangular bullet in a few places, so I made it consistent. Semantically the small triangle might be more appropriate, because we do not use the glyph as a point marker, but I think the triangular bullet aligns better with the text (it’s raised above the baseline where the triangle seems to just touch the baseline).
This is done by setting the ‘disableJavaScriptAPI’ key to ‘true’ in the tmCommand file.
The rationale behind this is that a command like “HTML → Show Preview” is using the HTML output view with user data which should not have access to the special TextMate JavaScript object, for example a user may have a `<script>` tag that loads JavaScript from a CDN, and such script would effectively have shell access to the user’s machine.
Most of these layout changes are related to the common pattern we used to set constraints for "dividers", where one of the dividers is specified to be connected to both edges of its superview then setting the other dividers' constraints to have equal widths (e.g., @"H:|[divider(==divider2,==divider3)]"). On 10.12, this now appears to result in ambiguous layout. We can resolve it by connecting at least one of the edges for each divider to its superview.
The textClipping file is saved as a binary plist on 10.11 and 10.12 (I could not verify 10.10) so we can eventually replace the use of FSRef here as well.
Although this is actually deprecated in 10.10, new APIs are available in 10.9 and it will make addressing deprecation warnings when upgrading to 10.10 easier.