Assign ⌘. to the commit window’s cancel button

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:).
Let OakTextView handle cancelOperation: as complete:

This is only when caret is at a word, when not on a word, we do not respond to the cancelOperation: method. This way, pressing escape in a window where another responder implements cancel:/cancelOperation: (e.g. commit window) the key will be handled by the other responder (and presumably close the window).
When document changes (on disk) ensure all selections are valid