From c49e4dc287701af125674f91ea917e36cd973dce Mon Sep 17 00:00:00 2001 From: Dawid Dziurla Date: Mon, 3 Sep 2018 18:07:38 +0200 Subject: [PATCH] get item position from correct panel --- pkg/gui/commits_panel.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/gui/commits_panel.go b/pkg/gui/commits_panel.go index 2c1cc6178..605566505 100644 --- a/pkg/gui/commits_panel.go +++ b/pkg/gui/commits_panel.go @@ -141,7 +141,7 @@ func (gui *Gui) handleCommitFixup(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handleRenameCommit(g *gocui.Gui, v *gocui.View) error { - if gui.getItemPosition(v) != 0 { + if gui.getItemPosition(gui.getCommitsView(g)) != 0 { return gui.createErrorPanel(g, gui.Tr.SLocalize("OnlyRenameTopCommit")) } gui.createPromptPanel(g, v, gui.Tr.SLocalize("RenameCommit"), func(g *gocui.Gui, v *gocui.View) error { @@ -157,7 +157,7 @@ func (gui *Gui) handleRenameCommit(g *gocui.Gui, v *gocui.View) error { } func (gui *Gui) handleRenameCommitEditor(g *gocui.Gui, v *gocui.View) error { - if gui.getItemPosition(v) != 0 { + if gui.getItemPosition(gui.getCommitsView(g)) != 0 { return gui.createErrorPanel(g, gui.Tr.SLocalize("OnlyRenameTopCommit")) }