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.
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.
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.
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).
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.
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.
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.
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).
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.
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.
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)
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.