diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2018-11-14 19:35:51 +1100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-14 19:35:51 +1100 |
commit | b8d5adcb84cc7eaa76be74a097be7ec4595a1f4e (patch) | |
tree | f3ef4ef6900ed38b072ca6839c24b6b683b01003 | |
parent | 79ef98739dbacbe8dde065894dba6c12375b40d7 (diff) | |
parent | 775d910bdc0fb01a24d0a9b8b3e985a80d8e560e (diff) |
Merge branch 'master' into feature/translations
-rw-r--r-- | docs/Config.md | 1 | ||||
-rw-r--r-- | pkg/config/app_config.go | 1 | ||||
-rw-r--r-- | pkg/gui/gui.go | 7 |
3 files changed, 8 insertions, 1 deletions
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 |