diff options
author | Daniele D'Orazio <d.dorazio96@gmail.com> | 2018-08-29 14:27:17 +0200 |
---|---|---|
committer | Daniele D'Orazio <d.dorazio96@gmail.com> | 2018-09-01 12:14:42 +0200 |
commit | 9e6a4a529af999b7c6b2adefe16632f2e19c5b8a (patch) | |
tree | a926c78ab48897564f5a60c6958f73bd5b39ca8a /pkg/gui/commits_panel.go | |
parent | b65fa852f187c820901e67f77b1fb8ac8dbd4ea3 (diff) |
add keybinding to open user editor when renaming last commit
Diffstat (limited to 'pkg/gui/commits_panel.go')
-rw-r--r-- | pkg/gui/commits_panel.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index c428e3b99..0969692b6 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -155,6 +155,19 @@ func (gui *Gui) handleRenameCommit(g *gocui.Gui, v *gocui.View) error { return nil } +func (gui *Gui) handleRenameCommitEditor(g *gocui.Gui, v *gocui.View) error { + if gui.getItemPosition(v) != 0 { + return gui.createErrorPanel(g, gui.Tr.SLocalize("OnlyRenameTopCommit")) + } + + gui.SubProcess = gui.GitCommand.PrepareCommitAmendSubProcess() + g.Update(func(g *gocui.Gui) error { + return gui.Errors.ErrSubProcess + }) + + return nil +} + func (gui *Gui) getSelectedCommit(g *gocui.Gui) (commands.Commit, error) { v, err := g.View("commits") if err != nil { |