@@ -368,7 +368,12 @@
"ctrl-\\": "pane::SplitRight",
"ctrl-k v": "markdown::OpenPreviewToTheSide",
"ctrl-shift-v": "markdown::OpenPreview",
- "ctrl-alt-shift-c": "editor::DisplayCursorNames"
+ "ctrl-alt-shift-c": "editor::DisplayCursorNames",
+ "ctrl-alt-y": "git::ToggleStaged",
+ "alt-y": "git::StageAndNext",
+ "alt-shift-y": "git::UnstageAndNext",
+ "alt-.": "editor::GoToHunk",
+ "alt-,": "editor::GoToPrevHunk"
}
},
{
@@ -705,12 +710,6 @@
"space": "project_panel::Open"
}
},
- {
- "context": "GitPanel && !CommitEditor",
- "bindings": {
- "escape": "git_panel::Close"
- }
- },
{
"context": "GitPanel && ChangesList",
"bindings": {
@@ -722,16 +721,24 @@
"ctrl-shift-space": "git::UnstageAll",
"tab": "git_panel::FocusEditor",
"shift-tab": "git_panel::FocusEditor",
- "escape": "git_panel::ToggleFocus"
+ "escape": "git_panel::ToggleFocus",
+ "ctrl-enter": "git::Commit"
+ }
+ },
+ {
+ "context": "GitCommit > Editor",
+ "bindings": {
+ "enter": "editor::Newline",
+ "ctrl-enter": "git::Commit"
}
},
{
"context": "GitPanel > Editor",
"bindings": {
"escape": "git_panel::FocusChanges",
- "ctrl-enter": "git::Commit",
"tab": "git_panel::FocusChanges",
"shift-tab": "git_panel::FocusChanges",
+ "ctrl-enter": "git::Commit",
"alt-up": "git_panel::FocusChanges"
}
},
@@ -1059,17 +1059,15 @@ impl GitPanel {
}
}
- /// Commit all staged changes
fn commit(&mut self, _: &git::Commit, window: &mut Window, cx: &mut Context<Self>) {
- let editor = self.commit_editor.read(cx);
- if editor.is_empty(cx) {
- if !editor.focus_handle(cx).contains_focused(window, cx) {
- editor.focus_handle(cx).focus(window);
- return;
- }
+ if self
+ .commit_editor
+ .focus_handle(cx)
+ .contains_focused(window, cx)
+ {
+ self.commit_changes(window, cx)
}
-
- self.commit_changes(window, cx)
+ cx.propagate();
}
pub(crate) fn commit_changes(&mut self, window: &mut Window, cx: &mut Context<Self>) {