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).
While ⌘. already triggers any cancelOperation:/cancel: method found in the responder chain, making it explicit gives visual feedback when user press the key, and ensures that another control doesn’t get the key (by responding to cancelOperation:/cancel:).
This fixes a regression. The previous commit window allowed a "--log" option to be specified that would pre-populate the text view with the given argument.
Presently the ‘TM_DISPLAYNAME’ is conditionally available, allowing the name to contain the file name which it will work with.
Also fix a potential “out of range” exception. The validateMenuItem: could be called for a cached menu item (e.g. when the system resolves key equivalents) where we had no selection (nor did click any item), so we would access the row at index -1.
In practice we could source ‘.tm_properties’ with ‘TM_DISPLAYNAME’ set to “Commit” (and ‘TM_FILENAME/PATH’ unset) to use user’s ‘windowTitle’, though it could result in wrong titles for users who have configured window titles to include parent path components without proper fallback to ‘TM_DISPLAYNAME’.
The rationale is that while the user is writing a commit message they might be reminded of something that should be fixed before committing, so they’ll cancel but wish to come back to the partially written message later.
This was previously set to a pop-up menu, hence the need for a placeholder item to set the menu title. However, for pull-down menus, the first item is used as the title and remains fixed.
This difference in behavior caused the last used commit message (first item) not to be listed in the menu.
We set the name as:
'---/+++ file'
I wanted the display name to suggest a diff without calling it something directly as "file (diff)", so I thought '---/+++' would be a nice and condense way of indicating that.
This is based on the previous commit window code base. It replaces the NSTextView with a OakTextView for entering the commit messages. This allows us to take advantage of some of the git grammar features, e.g., fixup!.
If other SCM bundles are updated in the future to include any specific grammars, these can be used in the commit window by setting the bundle grammar to "text.SCM-commit", where SCM could be hg or svn for example.
Changes to note:
* The Modify row button for the "--action-cmd" commands are now implemented in the action menu and the table context menu.
* The shortcut for committing is ⌘↩ (but fn-return seems to (still) work).
This allows the commit command line tool to open a window as “native”.
We use distributed objects for talking to TextMate and getting a response. For the response, we release the connection in the next iteration of the event loop and then gracefully exit the program. Though it’s not clear if this is enough time for distributed objects to reply the client (if not, an exception is thrown in the client about “connection disappeared while waiting for a reply”).