summaryrefslogtreecommitdiffstats
path: root/pkg/gui/stash_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-03-09 11:34:10 +1100
committerJesse Duffield <jessedduffield@gmail.com>2020-03-09 12:23:13 +1100
commite47ad846c4b6100aaff7013a3516d329bde19194 (patch)
treeead7f3f0a911d7ee4f4f46640c2bf449a74e8e05 /pkg/gui/stash_panel.go
parent8f68ac21293f1a0476802974817d9f87875f8743 (diff)
big golangci-lint cleanup
Diffstat (limited to 'pkg/gui/stash_panel.go')
-rw-r--r--pkg/gui/stash_panel.go16
1 files changed, 9 insertions, 7 deletions
diff --git a/pkg/gui/stash_panel.go b/pkg/gui/stash_panel.go
index 92d84df9f..8a8994fdb 100644
--- a/pkg/gui/stash_panel.go
+++ b/pkg/gui/stash_panel.go
@@ -34,9 +34,7 @@ func (gui *Gui) handleStashEntrySelect(g *gocui.Gui, v *gocui.View) error {
if stashEntry == nil {
return gui.newStringTask("main", gui.Tr.SLocalize("NoStashEntries"))
}
- if err := gui.focusPoint(0, gui.State.Panels.Stash.SelectedLine, len(gui.State.StashEntries), v); err != nil {
- return err
- }
+ v.FocusPoint(0, gui.State.Panels.Stash.SelectedLine)
cmd := gui.OSCommand.ExecutableFromString(
gui.GitCommand.ShowStashEntryCmdStr(stashEntry.Index),
@@ -97,9 +95,11 @@ func (gui *Gui) stashDo(g *gocui.Gui, v *gocui.View, method string) error {
return gui.createErrorPanel(g, errorMessage)
}
if err := gui.GitCommand.StashDo(stashEntry.Index, method); err != nil {
- gui.createErrorPanel(g, err.Error())
+ return gui.createErrorPanel(g, err.Error())
+ }
+ if err := gui.refreshStashEntries(g); err != nil {
+ return err
}
- gui.refreshStashEntries(g)
return gui.refreshFiles()
}
@@ -109,9 +109,11 @@ func (gui *Gui) handleStashSave(stashFunc func(message string) error) error {
}
return gui.createPromptPanel(gui.g, gui.getFilesView(), gui.Tr.SLocalize("StashChanges"), "", func(g *gocui.Gui, v *gocui.View) error {
if err := stashFunc(gui.trimmedContent(v)); err != nil {
- gui.createErrorPanel(g, err.Error())
+ return gui.createErrorPanel(g, err.Error())
+ }
+ if err := gui.refreshStashEntries(g); err != nil {
+ return err
}
- gui.refreshStashEntries(g)
return gui.refreshFiles()
})
}