369 Commits

Author SHA1 Message Date
Allan Odgaard
7e69f5bb2c Fix compiler warnings by initializing struct members in correct order 2021-02-04 09:35:27 +01:00
Allan Odgaard
8ed4b43b63 Remove “Add License” button from window chrome 2021-01-13 22:59:11 +01:00
Jordan Rose
ea09ac026b Add "Close Tabs to the Left" as alternate of "Close Tabs to the Right"
This is useful when working with one set of files in a project, then moving to another set without closing the original set first.

Alternate menu items are pretty subtle, but there are already a lot of ways to close tabs, and I didn't want to clutter the menu further.
2020-12-29 15:57:09 +01:00
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
066acad708 Remove use of WATCH_LEAKS (C++) 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
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
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
2c407be15b Obtain OS version via NSProcessInfo.processInfo.operatingSystemVersion
The oak::os_major, oak::os_minor, and oak::os_patch functions are wrapping deprecated API.
2020-05-22 21:48:09 +07:00
Allan Odgaard
3ea2cd2423 Use compile-time string concatenation instead of %s 2020-05-22 21:48:09 +07:00
Allan Odgaard
dce26956e7 Rename methods and constants to use software update in singular form
The program only checks for a single update.
2020-05-22 21:48:09 +07:00
Allan Odgaard
05cf51d42e Move software update signing key to Info.plist
This simplifies usage of the software update singleton and still allows to use it in other projects that have different signing key(s).
2020-05-22 21:48:09 +07:00
Allan Odgaard
733ab302e2 Change variable name: observerId → token
Several places already used ‘token’ as the name for the result from NSNotificationCenter’s addObserver:… so this change is to be consistent.

While ‘token’ is less meaningful than ‘observerId’, the variable is only used with NSNotificationCenter API where the context makes it clear.
2020-05-22 21:48:09 +07:00
Allan Odgaard
569dc9a198 Make token used in notification block weak as it retains the block
This is not made clear from the documentation, however, the documentation does state that the token will be strongly held by the notification center, until the notification is removed, therefore it is safe to only keep a weak reference to the token (even if the implementation should change).
2020-05-22 21:48:09 +07:00
Ronald Wampler
dde90fe4f5 Fix crash in AboutWindowController when license owner is nil 2020-05-14 20:42:52 +07:00
Allan Odgaard
a7e23d2722 Expose automatic theme switching in View → Themes submenu
Theme is now stored only with OakTextView (observed by OakDocumentView) and the “global” setting is stored in user defaults (not Global.tmProperties), though it is still possible to override theme on a file-by-file basis via .tm_properties files.
2020-05-14 15:43:24 +07:00
Allan Odgaard
ad1cc8abd8 Deliver all NSUserDefaultsDidChangeNotification in main queue
This is easier than ensuring that we do not update user defaults from a background thread.
2020-05-14 09:52:38 +07:00
Allan Odgaard
8e6791324a Let app delegate handle workaround for “Move to Active Space” behavior
I don’t think the default behavior ever makes sense, so we are applying the change to all windows instead of handling it on a one-by-one basis.
2020-05-13 18:50:02 +07:00
Allan Odgaard
0e1c51c0bd Eliminate redundant content view in About window 2020-05-13 18:49:55 +07:00
Allan Odgaard
611431bd80 Use WKWebView in the about window
To get scroll content behind title/toolbar we need to set NSWindowStyleMaskFullSizeContentView which appears to have been inferred with the old (deprecated) WebView.
2020-05-13 18:49:55 +07:00
Allan Odgaard
16aa95a018 Use NSPanel for the about window
This is basically just so that we can close it with the escape key.
2020-05-13 18:49:55 +07:00
Allan Odgaard
2c04850b46 Use a Dark Mode media query for the About window’s CSS colors 2020-05-13 18:49:55 +07:00
Allan Odgaard
9bfae1aada Use FFSearchTarget instead of find_tags enumeration
This avoids the need to map between the two enumeration constants, although we handle some of the constants before passing them to the find singleton, so the code has not yet been updated to remove the redundant mappings.
2020-05-10 20:07:31 +07:00
Allan Odgaard
9103d32ed8 Don’t associate real name with public signing keys
They already have a unique identifier.
2020-05-10 20:07:30 +07:00
Allan Odgaard
caaa36161d Change most fprintf log statements to using os_log 2020-05-04 19:20:04 +07:00
Allan Odgaard
9f822f6580 Remove handling of SIGUSR1 (would previously cause a relaunch) 2020-04-30 13:28:24 +07:00
Allan Odgaard
e6ceaf86b4 Rework code that checks if ⌘[ / ⌘] should be text or navigation actions
The property is renamed from ‘currentResponderIsOakTextView’ to the more appropriate ‘keyWindowHasBackAndForwardActions’.

Furthermore, the menu items are found via indexOfItemWithTarget:andAction: instead of by title, although the title of the submenus for these menu items is still hardcoded.
2020-04-28 12:35:43 +07:00
Allan Odgaard
02a6128571 Change check for when ⌘[ / ⌘] should be Shift Left/Right or Back/Forward
The problem is that if shiftLeft:/shiftRight: exist after goBack:/goForward: in the responder chain, we would prefer the former. This can happen because main window is after the key window in the responder chain, so if the former contains an OakTextView, a potential responder in the key window would never be found.
2020-04-28 09:52:10 +07:00
Allan Odgaard
6328ac68b5 Remove some migration code that should no longer be relevant 2020-04-23 12:25:11 +07:00
Allan Odgaard
b514114ec7 Access most system singletons using dot syntax
These are identified by having a prefix of shared, default, or standard in the class method.
2020-04-23 12:25:11 +07:00
Allan Odgaard
814a3c78b4 Access sharedInstance using dot syntax 2020-04-23 12:25:11 +07:00
Allan Odgaard
715d023673 Declare “sharedInstance” as a class property 2020-04-23 12:25:11 +07:00
Allan Odgaard
f4c863c6aa Use a GCD source for observing sockets instead of CFSocket
This is motivated by having received several crash reports from CFSocketManager over the years, example crash log from TextMate 2.0.8:

    Thread 5 Crashed:: com.apple.CFSocket.private
    0  libsystem_kernel.dylib    os_fault_with_payload + 10
    1  libsystem_kernel.dylib    __darwin_check_fd_set_overflow.cold.1 + 31
    2  libsystem_kernel.dylib    __darwin_check_fd_set_overflow + 79
    3  com.apple.CoreFoundation  __CFSocketManager + 939
    4  libsystem_pthread.dylib   _pthread_start + 148
    5  libsystem_pthread.dylib   thread_start + 15
2020-04-22 22:28:55 +07:00
Allan Odgaard
a7ca1f0fb3 Remove support for redirecting stderr to a file 2020-04-19 14:32:30 +07:00
Allan Odgaard
1b061f0dfa Change sourceIndex property to an unsigned integer
This is to match the property that it is bound to.
2020-04-17 19:19:53 +07:00
Allan Odgaard
2bdce95293 Refactor OakScopeBarView to be a view controller subclass 2020-04-17 19:19:53 +07:00
Andreas
e62bbea182 Miscapitalization of Menu Items
`Jump to Next/Previous Mark` should be capitalized like `Jump to Next/Previous Bookmark`. Prepositions are generally not capitalized in title case.
2020-04-14 13:01:43 +07:00
Allan Odgaard
3a21cbfd85 Move Go To… menu updating and next/previous actions to ScopeBarView 2020-04-14 12:58:11 +07:00
Allan Odgaard
d63f12993f Use class properties for general, find, and replace pasteboard instances 2020-04-14 12:58:10 +07:00
Allan Odgaard
d0c43840c6 Remove code that was migrating settings from beta release of TextMate 2020-04-14 12:58:10 +07:00
Allan Odgaard
8059ca1fc1 Add helper to create NSBoxSeparator view 2020-03-20 16:18:12 +07:00
Allan Odgaard
079377ed49 Require macOS 10.12 and remove compatibility checks 2019-10-07 21:28:16 +02:00
Allan Odgaard
36dc1374f9 Revert "Add debug output when TextMate is activated via mate"
This reverts the following 3 commits:

- commit 306d46ec71
- commit eecfe6e619
- commit 2ffc74ad8b
2019-08-26 21:19:17 +02:00
Allan Odgaard
ad74df7824 Include explanation in the log message for when a plug-in fails to load
Credit: https://lists.macromates.com/textmate/2019-July/041047.html
2019-07-15 21:41:30 +02:00
Allan Odgaard
2ffc74ad8b Add debug output when TextMate is activated via mate
Some users report a significant delay from executing mate until the TextMate window is brought to front.

The debug information can be extracted by running the following in a terminal:

    log show --predicate 'subsystem = "com.macromates.TextMate" && category = "BringToFront"'

Alternatively use `stream` instead of `log` to get a live stream of debug output.

See `man log` for options such as `--start date/time` (to limit the query to e.g. the last 10 minutes)
2019-07-13 10:20:09 +02:00
Allan Odgaard
11d67f3a22 Avoid NSString’s deprecated percent encoding methods 2019-06-30 10:32:45 +02:00
Ronald Wampler
b71efb0065 Add support for "Customize Touch Bar…" in MenuBuilder 2019-06-30 10:32:45 +02:00