Commit Graph

5560 Commits

Author SHA1 Message Date
Allan Odgaard
fbc78d3b37 Remove initialization of libcurl
We no longer use libcurl anywhere in TextMate, so this line is no longer necessary.
2020-06-09 16:48:37 +07:00
Allan Odgaard
0f219bae4b Set (visible) key equivalents for file browser context menu
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.
2020-06-09 16:48:37 +07:00
Allan Odgaard
6e35cb98e1 Only update file browser menu item titles when it is the explicit target
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.
2020-06-09 16:48:37 +07:00
Allan Odgaard
b0228b9aff Remove redundant target setting from file browser context menu
We set target for all items in the menu during post-processing.
2020-06-09 16:48:37 +07:00
Allan Odgaard
f97946244a Let file browser call copyAsPathname: when seeing ⌥⌘C
We cannot do this via a menu item because this key equivalent is already used for Ignore Case in the Edit → Find → Find Options menu.
2020-06-09 16:48:37 +07:00
Allan Odgaard
f1a1e1920f Handle file browser shortcuts in performKeyEquivalent:
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.
2020-06-09 16:48:37 +07:00
Allan Odgaard
75a08d141b Use os_log_error when assertions fail 2020-06-07 16:50:18 +07:00
Allan Odgaard
da04968f17 Change target file for OakDebug to not link as a bundle
This was from back when each framework was built independently.
2020-06-05 21:22:50 +07:00
Allan Odgaard
249f365e70 Remove majority of code from OakDebug framework 2020-06-05 21:22:50 +07:00
Allan Odgaard
b2ace31314 Remove comment about _GLIBCXX_DEBUG
Unsure if this has any meaning for libc++.
2020-06-05 21:22:50 +07:00
Allan Odgaard
e141a97d26 Remove include of <oak/debug/OakDebugLog.h> 2020-06-05 21:22:50 +07:00
Allan Odgaard
066acad708 Remove use of WATCH_LEAKS (C++) 2020-06-05 21:22:50 +07:00
Allan Odgaard
e80ef1d0b7 Remove use of OBJC_WATCH_LEAKS 2020-06-05 21:22:50 +07:00
Allan Odgaard
b63441b648 Remove commented debug statements 2020-06-05 21:22:50 +07:00
Allan Odgaard
95655fbe18 Move BSTR macro to crash/info.h 2020-06-05 21:22:50 +07:00
Allan Odgaard
44fbea7dc6 Avoid using BSTR macro in OakDocument.mm
This is a debug macro that shouldn’t be used by non-debug code.
2020-06-05 21:22:50 +07:00
Allan Odgaard
bfd1bcf3f0 Remove ‘to_s’ functions previously used by log statements 2020-06-05 21:22:50 +07:00
Allan Odgaard
c93030b385 Remove all debug output from custom log macros
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.
2020-06-05 21:22:50 +07:00
Allan Odgaard
5246f168a4 Call os_log_error if AESendMessage fails 2020-06-05 21:22:50 +07:00
Allan Odgaard
f000204330 Remove PUBLIC macro 2020-06-05 21:22:50 +07:00
Allan Odgaard
4ec10c0923 Don’t annotate types and classes with PUBLIC
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.
2020-06-05 21:22:50 +07:00
Allan Odgaard
70988c684f Use a custom class for favorite items (instead of NSDictionary) 2020-06-03 21:25:36 +07:00
Allan Odgaard
3d721f908c Use ‘valueForKey:’ to get ‘path’ from items in didSelectFavorite:
This allows path to be either stored in a dictionary (as currently done) or be a getter method of a custom subclass.
2020-06-03 21:22:43 +07:00
Allan Odgaard
312514665c Remove find_t::match API 2020-06-03 21:21:46 +07:00
Allan Odgaard
a69d4acace Update find tests to use find_t::each_match
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).
2020-06-03 21:21:46 +07:00
Allan Odgaard
906aea3cca Use new find_t::each_match in folder search 2020-06-03 21:21:46 +07:00
Allan Odgaard
1807339f9c Use new find_t::each_match in document search 2020-06-03 21:21:46 +07:00
Allan Odgaard
18d2fd6f7f Add simpler (low-level) API for performing a search 2020-06-03 21:21:46 +07:00
Allan Odgaard
f700b8d960 Remove API to set skip offset when performing a search 2020-06-03 21:21:46 +07:00
Allan Odgaard
b96bfad7b2 Files with .mm.rl extension are now built as Objective-C++
Previously all .rl files would be built as C++.
2020-06-03 21:21:46 +07:00
Allan Odgaard
4f8a3e3aa4 Use longest suffix match when more than one build rule can build a file
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.
2020-06-03 21:21:46 +07:00
Allan Odgaard
b1e41a7f5f Abort iterating over parent URLs if the path string grows in length
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/’.
2020-05-30 10:02:52 +07:00
Allan Odgaard
eaad76f83d Minor tweak of log message 2020-05-30 09:54:30 +07:00
Allan Odgaard
9095325e68 Tweak layout constraints of footer in Select Bundle Item window
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.
2020-05-30 08:55:22 +07:00
Allan Odgaard
a36bc310d0 Usage text for the process_plist script was using a wrong program name 2020-05-30 08:55:22 +07:00
Allan Odgaard
b663d0b520 Support passing arguments to ragel via RAGEL_FLAGS
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.
2020-05-30 08:55:22 +07:00
Allan Odgaard
c41804c267 Let ninja run tests in the console pool
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.
2020-05-30 08:55:22 +07:00
Allan Odgaard
e5dee67693 Improve how we update key view loop in transition view controller 2020-05-25 12:47:47 +07:00
Allan Odgaard
670f5ba756 Let preferences window recalculate key view loop and set first responder
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.
2020-05-25 12:47:47 +07:00
Allan Odgaard
6aef0f069c Do not recalculate key view loop in OakTransitionViewController
Also do not change first responder, as this belongs at a higher level, where we know which view would be a suitable first responder.
2020-05-25 12:47:47 +07:00
Allan Odgaard
70ad04d554 Improve check for setting first responder for bundles preferences
For example when opening the window for the first time, the first responder will already have been setup when reaching the viewDidAppear method.
2020-05-25 12:47:47 +07:00
Allan Odgaard
df3b4bb807 Don’t call OakSetupKeyViewLoop with just a single view
In this case, the function is a no-op.
2020-05-25 12:47:47 +07:00
Allan Odgaard
344ed58819 Don’t set autorecalculatesKeyViewLoop to NO (as it is the default value) 2020-05-25 12:47:47 +07:00
Allan Odgaard
d500f6e53d Remove support for initial first responder in OakSetupKeyViewLoop 2020-05-25 12:47:47 +07:00
Allan Odgaard
58d1cce527 Do not rely on OakSetupKeyViewLoop to set initial first responder
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.
2020-05-25 12:47:47 +07:00
Allan Odgaard
3818da6410 Remove support for NSNull in OakSetupKeyViewLoop
Also specify the object type (NSView*) for the arrays passed to OakSetupKeyViewLoop and OakAddAutoLayoutViewsToSuperview.
2020-05-25 12:47:47 +07:00
Allan Odgaard
74e03499ab Do not pass NSNull objects to OakSetupKeyViewLoop for non-existing 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.
2020-05-25 12:39:58 +07:00
Allan Odgaard
7369f785c2 Improve log message for a failed download 2020-05-24 17:27:16 +07:00
Allan Odgaard
a3cd28370a Move OakCompareVersionStrings function to SoftwareUpdate framework 2020-05-24 17:27:16 +07:00
Allan Odgaard
fda314ef9b Move OakDownloadManager to SoftwareUpdate framework 2020-05-24 17:27:16 +07:00