diff --git a/docs/Config.md b/docs/Config.md index 7f342df7f..dfbbdb10b 100644 --- a/docs/Config.md +++ b/docs/Config.md @@ -6,6 +6,7 @@ gui: # stuff relating to the UI scrollHeight: 2 # how many lines you scroll by + scrollPastBottom: true # enable scrolling past the bottom theme: activeBorderColor: - white diff --git a/pkg/config/app_config.go b/pkg/config/app_config.go index 7cde63de1..f789349b4 100644 --- a/pkg/config/app_config.go +++ b/pkg/config/app_config.go @@ -214,6 +214,7 @@ func GetDefaultConfig() []byte { `gui: ## stuff relating to the UI scrollHeight: 2 + scrollPastBottom: true theme: activeBorderColor: - white diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 35448922a..ee8fb1165 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -130,7 +130,12 @@ func (gui *Gui) scrollUpMain(g *gocui.Gui, v *gocui.View) error { func (gui *Gui) scrollDownMain(g *gocui.Gui, v *gocui.View) error { mainView, _ := g.View("main") ox, oy := mainView.Origin() - if oy < len(mainView.BufferLines()) { + y := oy + if !gui.Config.GetUserConfig().GetBool("gui.scrollPastBottom") { + _, sy := mainView.Size() + y += sy + } + if y < len(mainView.BufferLines()) { return mainView.SetOrigin(ox, oy+gui.Config.GetUserConfig().GetInt("gui.scrollHeight")) } return nil