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 is instead of the more opaque OakCreateHorizontalLine(OakBackgroundFillViewStyleDivider).
Also use NSLayoutFormatAlignAllLeading with the visual format language instead of manually creating constraints for the dividers.
Also, switch to use the new divider styles in most places. The remaining usage of the old "OakCreateLine" functions are in the OakChooser windows. These will be refactor for better dark mode support next.
Most of these layout changes are related to the common pattern we used to set constraints for "dividers", where one of the dividers is specified to be connected to both edges of its superview then setting the other dividers' constraints to have equal widths (e.g., @"H:|[divider(==divider2,==divider3)]"). On 10.12, this now appears to result in ambiguous layout. We can resolve it by connecting at least one of the edges for each divider to its superview.
When executing a bundle item without any default document open, we may first “load” the document, which is done via a callback (for when the document is loaded), and at that time, the bundle item reference has become invalid.
This was never necessary since our documentView will set this to
document_ptr() when it's released, though it was harmless. But now,
document_ptr is just a thin wrapper around OakDocument and the default
constructor does nothing. As a result we were basically setting the
text view OakDocument instance to nil.
After commit f9e02d9, when the commit window closes, this would
noticeably cause the text view to turn "white" when using a dark theme.
Some targets were including headers from frameworks not specified in their link dependencies. For a clean build this could cause an issue because the header was not available at the time of building the target.
The updated link dependencies are also based on what a target’s tests require. Ideally tests would have separate link dependencies, but as we don’t want to maintain this manually, this will have to wait until the build system automatically handles link dependencies.
Currently the commit command uses constants from the CommitWindow framework but should actually not be linked with it. However, the optimizer will strip dead code, so it should not result in much if any difference in the resulting binary and does solve a build dependency issue.
This allows us to set arbitrary titles, should we need it in the future.
It also changes the code slightly so that there is only one method to create the full button title.
The use case for this feature is when an interactive rebase is in
progress and be able to, in one command, amend the current commit
and continue with rebase.
By default, if the --rebase-in-progress flag is passed when the
"commit" command is invoked the commit button will be in a
"commit and continue" state. This is indicated by the title of the
commit button now being "Commit & Continue". If the option (⌥) key
is being hold down the state will revert back to the standard "commit"
state and the title will change to "Continue".
If the butten was clicked when it was in the "commit and continue"
state the "commit" command will print "TM_SCM_COMMIT_CONTINUE=1"
(without the quotes) to stdout as the last line. If the button was
clicked when it was in the standard "commit" state the output may
contain "TM_SCM_COMMIT_CONTINUE=0", or the "TM_SCM_COMMIT_CONTINUE"
string will be absent.
The property is “assign” so in theory the text field could be released before we add it to its superview. Using the local variable ensures that won’t happen.
The view layout is rearranged in order to animate showing the table, which is now shown below the toggle button with the Cancel and Commit buttons sliding down. Additionally, when not showing the table we remove all relevant views from memory.
Previously, the commit window was changed from a "always on top" window to a more typical window that could be minimized or sent to the background. While this made viewing the diffs more convenient, we could easily loose track of it or at worst end up with multiple dangling commit windows. By making it document modal, this prevents dangling windows. Furthermore, since the commit window is now attached to the main project window and the file browser already has the SCM status, we hide the file list by default and dropped the action button. Users can choose to show the file list via a checkbox and the action button's menu is still available via the file list's context menu.
Originally, the "--ask" option was used in the previous commit window to change the NSTextField above the text view; however, no SCM bundles (in textmate's repos) currently uses it.
This change was prompted by the appearance of the `tabSizePopUp` button in the status bar. After dismissing the menu, the title would be disabled.
To ensure we do not have similar issues elsewhere, let's prefer the use of `NULL` to `nop:` when assigning the action for menu items unless we are sure that the menu item should always be disabled (e.g., the item is used as a label).