First, some background:
The Sublime Git Package binds “Enter” to the GotoDiff command in the context of diff syntax.
This works well for “pure” diff files, but it throws in the context of a diff file that is the result of a manual hunk editing mode. In this context, it’s also useful to be able to use the default Enter action.
So I modified the plugin to use this code if it’s not a “real” diff file:
for sel in self.view.sel():
self.view.insert(edit, sel.begin(), "\n")
Now that work in the most basic case, but e.g. if you have a text selection, normally Enter would delete the selection, the above doesn’t.
So the question is, is there a way to fall back on the original command that was overwritten in the key binding? I simply want to say, oh, I didn’t want to execute this command after all, please do whatever the default was. Or if there’s not, maybe my code could be improved?