diff options
| author | Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> | 2018-12-08 18:50:45 +0300 |
|---|---|---|
| committer | Ibrahim Serdar Acikgoz <serdaracikgoz86@gmail.com> | 2018-12-08 18:50:45 +0300 |
| commit | d95367a707ffd121e78a07f6a0d1d030fc4ac6b9 (patch) | |
| tree | 7869fcdffa7d781c2c90cae249c07935b9d62aa9 /pkg/gui/keybindings.go | |
| parent | Merge remote-tracking branch 'origin/master' into develop (diff) | |
| download | gitbatch-d95367a707ffd121e78a07f6a0d1d030fc4ac6b9.tar.gz | |
git add, git reset and git stash implementation added.
Diffstat (limited to 'pkg/gui/keybindings.go')
| -rw-r--r-- | pkg/gui/keybindings.go | 88 |
1 files changed, 87 insertions, 1 deletions
diff --git a/pkg/gui/keybindings.go b/pkg/gui/keybindings.go index 55c86bd..e808959 100644 --- a/pkg/gui/keybindings.go +++ b/pkg/gui/keybindings.go @@ -152,6 +152,14 @@ func (gui *Gui) generateKeybindings() error { Display: "j", Description: "Down", Vital: false, + }, { + View: view.Name, + Key: 't', + Modifier: gocui.ModNone, + Handler: gui.stashChanges, + Display: "t", + Description: "Save to Stash", + Vital: true, }, } for _, binding := range statusKeybindings { @@ -159,6 +167,52 @@ func (gui *Gui) generateKeybindings() error { } } individualKeybindings := []*KeyBinding{ + // stash view + { + View: stashViewFeature.Name, + Key: 'p', + Modifier: gocui.ModNone, + Handler: gui.popStash, + Display: "p", + Description: "Pop Item", + Vital: true, + }, + // staged view + { + View: stageViewFeature.Name, + Key: 'r', + Modifier: gocui.ModNone, + Handler: gui.resetChanges, + Display: "r", + Description: "Reset Item", + Vital: true, + }, { + View: stageViewFeature.Name, + Key: gocui.KeyCtrlR, + Modifier: gocui.ModNone, + Handler: gui.resetAllChanges, + Display: "ctrl+r", + Description: "Reset All Items", + Vital: true, + }, + // unstaged view + { + View: unstageViewFeature.Name, + Key: 'a', + Modifier: gocui.ModNone, + Handler: gui.addChanges, + Display: "a", + Description: "Add Item", + Vital: true, + }, { + View: unstageViewFeature.Name, + Key: gocui.KeyCtrlA, + Modifier: gocui.ModNone, + Handler: gui.addAllChanges, + Display: "ctrl+a", + Description: "Add All Items", + Vital: true, + }, // Main view controls { View: mainViewFeature.Name, @@ -502,7 +556,39 @@ func (gui *Gui) generateKeybindings() error { Display: "c", Description: "close/cancel", Vital: true, - }, + }, { + View: errorViewFeature.Name, + Key: gocui.KeyArrowUp, + Modifier: gocui.ModNone, + Handler: gui.fastCursorUp, + Display: "↑", + Description: "Up", + Vital: true, + }, { + View: errorViewFeature.Name, + Key: gocui.KeyArrowDown, + Modifier: gocui.ModNone, + Handler: gui.fastCursorDown, + Display: "↓", + Description: "Down", + Vital: true, + }, { + View: errorViewFeature.Name, + Key: 'k', + Modifier: gocui.ModNone, + Handler: gui.fastCursorUp, + Display: "k", + Description: "Up", + Vital: false, + }, { + View: errorViewFeature.Name, + Key: 'j', + Modifier: gocui.ModNone, + Handler: gui.fastCursorDown, + Display: "j", + Description: "Down", + Vital: false, + }, } for _, binding := range individualKeybindings { gui.KeyBindings = append(gui.KeyBindings, binding) |
