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