sublime_merge
sublime_merge copied to clipboard
Cmd+Enter does not enter edit_commit mode
Version info
- OS: macOS 12.6.1
- Build: 2077
Description
When I select a commit in a repo which I have edit access to and then press Cmd+Return, nothing happens. When I begin editing the commit message using the context menu > Edit Commit > Edit Commit Message, I can stop editing and discard my changes using Escape. I can also save the commit message using Cmd+Return.
The default key bindings for OS X in the Sublime Merge package have these bindings, which I believe are relevant:
{ "keys": ["super+enter"], "command": "commit", "args": { "mode": "commit" },
"context": [{ "key": "setting.commit_message" }, { "key": "can_commit" }]
},
{ "keys": ["super+enter"], "command": "edit_commit",
"context": [{ "key": "setting.commit_message" }, { "key": "read_only" }]
},
{ "keys": ["super+enter"], "command": "save_commit_message",
"context": [{ "key": "setting.commit_message" }, { "key": "is_editing_commit" }]
},
{ "keys": ["escape"], "command": "cancel_edit_commit_message",
"context": [{ "key": "setting.commit_message" }, { "key": "is_editing_commit" }]
},
It appears that the first one isn't working. I don't understand what the second one is for. Maybe to allow selecting the text even in the case where you can't edit it?
I can enter commit mode as expected using this key binding:
{
"keys": ["super+enter"],
"command": "edit_commit",
"args": { "commit": "$commit" }
},
But then Cmd+Return doesn't work to STOP editing and save the new commit message.
Steps to reproduce
Steps to reproduce the behavior:
- Open repository with edit access
- Select a commit
- Press Cmd+Return
Expected behavior
Given the default key bindings, I'd expect this to begin editing the commit message. Instead, nothing happens.
Other info I also discussed this on the Sublime Forum.
I have turned on logging by setting "log_commands": true. When I press Cmd+Return, I get this in the console:
no command for selector: noop:
I've found that a way to fix the bindings so that everything behaves as expected is to put this in my personal keymap:
{
"keys": ["super+enter"],
"command": "edit_commit",
"context": [{ "key": "setting.commit_message" },
{ "key": "is_editing_commit", "operator": "not_equal" }]
},
I have tried this on Windows and it doesn't work there either. When I turn on log_commands, open the console and press Ctrl+Enter on a commit, nothing happens.
Wondering if the new logging mentioned in #1659 will help diagnose this issue as well? @dpjohnst Behavior hasn't changed in build 2079.
https://user-images.githubusercontent.com/3646730/231153609-4c952c27-a532-4b07-a1bb-7d92dc354dee.mp4
Hi @nk9,
Thanks for sharing that video - currently the keybinding ctrl + enter will only work if the commit message has focus.
You can use the tab key to switch focus in the GUI.
Could you confirm if the keybinding works when the commit message has focus?
As an aside, I can see the utility in allowing that keybinding to work when the commit in the graph has focus as well. I'll look into supporting this.
Thanks, - Dylan from Sublime HQ
Oh, interesting. Indeed, if you press Tab and then Cmd+Enter, then it works. Thanks for explaining. Of course, as soon as you cancel or commit the change, focus moves back to the graph and you have to use Tab one more time before you can use the shortcut again.
So I guess this is an enhancement request. But I'm really hopeful it's something that's possible to change soonish!