summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2018-11-14 19:35:51 +1100
committerGitHub <noreply@github.com>2018-11-14 19:35:51 +1100
commitb8d5adcb84cc7eaa76be74a097be7ec4595a1f4e (patch)
treef3ef4ef6900ed38b072ca6839c24b6b683b01003 /pkg
parent79ef98739dbacbe8dde065894dba6c12375b40d7 (diff)
parent775d910bdc0fb01a24d0a9b8b3e985a80d8e560e (diff)
Merge branch 'master' into feature/translations
Diffstat (limited to 'pkg')
-rw-r--r--pkg/config/app_config.go1
-rw-r--r--pkg/gui/gui.go7
2 files changed, 7 insertions, 1 deletions
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