629 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
e80ef1d0b7 Remove use of OBJC_WATCH_LEAKS 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
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
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
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
e98dd0ce32 Change key (in session state) used to store file browser state
We changed the type of file browser state from NSDictionary → NSData in 4a1e9113f3.

While we do check the type of the object read, previous versions did not, so if the user runs latest version of TextMate, and then downgrades, they will have state that cannot be read by the older version of TextMate (and will cause exception during launch, incase file browser state is restored).
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
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
c939c53f34 Don’t let HTMLOutputWindowController handle toggleHTMLOutput:
Now that the window is a panel, we can rely on the main window to close the window on toggle, even with the HTML window having key.
2020-05-13 18:50:02 +07:00
Allan Odgaard
90a2517600 Allow opening “Find in Project” from pasteboard history chooser
This is triggered by holding option when selecting Find Next. Improving discoverability is work in progress.
2020-05-10 20:07:31 +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
6fde32efac Move can_reach_host out of network framework
We only call this function from a single place, so no need to make it public API.
2020-05-04 19:20:04 +07:00
Allan Odgaard
e541250309 Add object type information when using OakHistoryList 2020-04-30 13:28:24 +07:00
Allan Odgaard
e4f61f12b7 Change a few leading spaces to tabs 2020-04-30 13:28:24 +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
d63f12993f Use class properties for general, find, and replace pasteboard instances 2020-04-14 12:58:10 +07:00
Allan Odgaard
61ec959b37 Change data type of file browser state from dictionary to opaque object
This gives us more flexibility in how we wish to represent the state, although the state should be a property list object.
2020-04-14 12:58:10 +07:00
Allan Odgaard
4013020b14 Use dot syntax for NSNumber’s boolValue property 2020-04-14 12:58:10 +07:00
Allan Odgaard
6c692099ff Change OakTabBarView to use tab item’s identifier in drag’n’drop API
This is instead of passing instances of the “internal” OakTabItem class.
2020-04-14 12:58:10 +07:00
Allan Odgaard
3cde965415 Make OakTabBarView’s selectedTabIndex a r/w property but no KVO support
The property returns NSNotFound when there is no selection. This seems to be consistent with NSArrayController’s selectionIndex (but inconsistent with many other views, like NSTableView, which return -1 when there is no selection).
2020-04-14 12:58:10 +07:00
Allan Odgaard
e3bd910e8c Change type of tab identifier from NSString to NSUUID
While AppKit identifiers are generally strings, which have more flexibility, I think this is mainly because NSUUID was introduced later, and for tab items, identifiers must be unique, which is not enforced (or implied) when using strings.
2020-04-14 12:58:10 +07:00
Allan Odgaard
67694d1b5a Use OakCreateNSBoxSeparator() in main (document) window 2020-04-14 12:58:10 +07:00
Allan Odgaard
d7ec9e6690 Use OakCreateNSBoxSeparator() for live search and grammar installation
This is instead of the more opaque OakCreateHorizontalLine(OakBackgroundFillViewStyleDivider).
2020-03-29 10:21:30 +07:00
Allan Odgaard
3428c5cdfb Fix missing default folder location for new file browser windows 2020-03-20 15:06:23 +07:00
Allan Odgaard
66bfb817d6 Set NSWindowAnimationBehaviorDocumentWindow for our document window 2020-02-29 13:18:55 +07:00
Allan Odgaard
aff1273d53 Context menu items for tabs would be disabled in full screen mode
Apparently the window’s delegate is not used for context menu actions in full screen mode, although NSApp’s targetForAction: does find the receiver, so this appears to be a framework bug.
2019-10-27 15:20:14 +01:00
Allan Odgaard
079377ed49 Require macOS 10.12 and remove compatibility checks 2019-10-07 21:28:16 +02:00
Allan Odgaard
3c7895f578 Simplify code by using NSOffsetRect 2019-10-06 10:35:55 +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
306d46ec71 Add even more debug output for when TextMate is activated via mate 2019-08-21 11:51:26 +02:00
Allan Odgaard
dae1103728 Update LINK declarations 2019-07-16 19:42:29 +02:00
Allan Odgaard
eecfe6e619 Add more debug output for when TextMate is activated via mate
Related to 2ffc74ad8b
2019-07-16 08:33:05 +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
Ronald Wampler
b1fdd4377b Allow customization of DocumentWindowController touch bar items 2019-06-30 10:32:45 +02:00
Ronald Wampler
2294d369d0 Add accessibility support for DocumentWindowController's touch bar 2019-06-29 19:21:45 -04:00
Ronald Wampler
d8b17a1f06 Let DocumentWindowController's touch bar support nested touch bars 2019-06-29 19:21:45 -04:00
Allan Odgaard
1ef78b3af7 Rename symbols to what’s expected by the 10.14 SDK 2019-06-29 20:14:15 +02:00
Allan Odgaard
b5b36a558b Add missing framework dependencies 2019-06-26 13:21:11 +02:00
Allan Odgaard
1a1a910c92 Introduce find dialog delegate instead of using project identifier 2018-12-06 22:00:22 +07:00
Allan Odgaard
7030b0041e Update documents array and selected document inside animation group 2018-12-02 18:08:38 +07:00
Allan Odgaard
f244e223fd Rename a few menu items 2018-11-20 22:21:50 +07:00
Allan Odgaard
180dfb971f Make document window controller’s document array a read only property
This is because we may sometimes want to enable implicit animations when updating this property, by making it read-only we limit places from where it can be updated, to make it easier to audit the code.

Currently no-one outside the class actually uses the property, so we could (and may) make it private.
2018-11-19 09:42:33 +07:00
Allan Odgaard
79172d552e Set controlSize on NSControl instead of its cell 2018-11-17 20:20:55 +07:00