Some of the items require the key equivalent to be set as “inactive” as menu item keys are “global” and thus need to be unique, and can be triggered even when the view containing the context menu is not active.
Previously “Paste Next” in the Edit → Paste submenu could have its title updated to “Move Item Here”, which would never be restored back to “Paste Next”, similarly for regular paste.
This commit also drops the wrappers for the cut:, copy:, paste:, and delete: methods, as these wrappers resulted in a bit of redundancy related to menu item validation.
This is called before the main menu acts on keys, and thus allows us to catch keys that are otherwise assigned to menu items.
We only do this when the file browser is first responder, so it should be acceptable to have a few menu keys change behavior in that case.
This provided value during early development, but has been unused for years, and it would generate too much noise if converted to os_log.
So better to just remove it all and add os_log statements as needed.
This was required when we linked each framework as its own thing, which we do not do anymore, and if we do go back to this system, we can simply have symbols public by default.
These tests are not exactly exhaustive and should probably be amended with more edge cases, especially now that the API has been simplified (so easier to add more tests).
For example we may specify a transform for ‘.rl → .cc’ and another for ‘.mm.rl → .mm’. For a file named ‘fsm.mm.rl’ the build system would use the first rule seen, now it will always pick the latter, as it matches more of the suffix.
It appears that NSURL’s algorithm for “delete last path component” is to first append ‘../’ and then “normalize” the result, but the latter step can fail for some file URLs, for example with “file://localhost/path/to/https://macromates.com/” it will be stuck at the two slashes (continuing to append ‘../’).
Such malformed (file) URL can be created by running ‘mate https://macromates.com/’.
I occasionally see the Edit or Select button stretched, i.e. the status bar text field hugs its content fully, this is despite its hugging priority being set to low.
I did try to set it to NSLayoutPriorityDefaultLow-10 (assuming hugging priority of the buttons is NSLayoutPriorityDefaultLow), but I still saw the problem, so now we just allow space between the status bar and the buttons, rather than rely on the status bar to be stretched.
The default for ragel is to generate compact and flexible code, not an issue for our current use case (parsing only comments and strings in ASCII property lists) but in the future we may need to tweak the output as ragel will be used for other things.
I think it will prevent multiple tests from being run in parallel, but when writing tests, we may produce a lot of output, that should not be buffered by ninja.
A future improvement could be to only use the console pool for the tests of the current target, but that will require two different rules to run tests.
None of our preference panes have custom key view loops, therefore it is safe to call recalculateKeyViewLoop, if however we do introduce custom key view loops, we will need to update this code to account for that.
We either set it explicitly or rely on automatic key view loop calculations.
As for the latter: When auto-layout was initially introduced, the automatic key view loop calculation broke, as it used the view frames before layout. It should have been fixed several OS versions ago though, so we can use it again, as long as we are not working with view-based table views.
We only need this in one location, and it’s easy to handle at that call-site, rather than add complexity to something which is already a little opaque.