diff options
Diffstat (limited to 'pkg/gui')
-rw-r--r-- | pkg/gui/gui.go | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index a5db4c394..89b99a919 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -1,6 +1,7 @@ package gui import ( + "math" "sync" // "io" @@ -181,10 +182,8 @@ func NewGui(log *logrus.Entry, gitCommand *commands.GitCommand, oSCommand *comma func (gui *Gui) scrollUpMain(g *gocui.Gui, v *gocui.View) error { mainView, _ := g.View("main") ox, oy := mainView.Origin() - if oy >= 1 { - return mainView.SetOrigin(ox, oy-gui.Config.GetUserConfig().GetInt("gui.scrollHeight")) - } - return nil + newOy := int(math.Max(0, float64(oy-gui.Config.GetUserConfig().GetInt("gui.scrollHeight")))) + return mainView.SetOrigin(ox, newOy) } func (gui *Gui) scrollDownMain(g *gocui.Gui, v *gocui.View) error { |