sublime_merge
sublime_merge copied to clipboard
Accidentally pressing CMD+S can irreversibly lose a long, detailed commit message.
Problem description
I lost a long commit message that took half an hour to write when I accidentally pressed CMD+S (my subconscious Sublime Text way to "Save important work").
Preferred solution
Up to you.
Alternatives
A description of any alternative solutions or enhancements considered.
Screenshots
If applicable, add screenshots to help demonstrate the problem or proposed solution. This section may be omitted/removed.
Hi @taliesinb,
Thanks for reaching out and sorry to hear you experienced this - this definitely sounds like a bug as this isn't expected behavior.
Could you confirm whether you were in the process of merging/cherry-picking/reverting commits?
In the general case, git stash shouldn't result in the commit message being lost but I've managed to reproduce the issue in the above states.
Cheers, - Dylan from Sublime HQ
I hit this problem all the time. As a regular user of sublime text, my motor memory expects the key binds in sublime merge to do the same thing and I'm constantly triggering stash by accident.
Alternative 1:
Rather than using a dropdown to select between "commit", "amend", and "amend without commit hooks", use a radio button to select between the actions and have a separate "commit" button to invoke the action. The cmd-s button can be bound to that commit button.
Alternative 2:
Have the "ctrl-s" button trigger an action that saves the edit buffer to disk, so that it can be recovered later if smerge is closed or killed.
Alternative 3:
Leave ctrl-s unbound in smerge and use some other default binding for stash.
@sxenos, regarding alternative 3, a workaround is to add this keybinding:
Default.sublime-keymap:
[
{ "keys": ["super+s"], "command": "noop" },
]