1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2024-11-26 09:00:57 +02:00

Merge pull request #326 from KOREAN139/master

add scroll-past-bottom configuration option
This commit is contained in:
Jesse Duffield 2018-11-14 18:49:21 +11:00 committed by GitHub
commit 775d910bdc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 8 additions and 1 deletions

View File

@ -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

View File

@ -214,6 +214,7 @@ func GetDefaultConfig() []byte {
`gui:
## stuff relating to the UI
scrollHeight: 2
scrollPastBottom: true
theme:
activeBorderColor:
- white

View File

@ -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