1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

add scroll-past-bottom configuration option

with gui.scrollPastBottom option true, lazygit let user scroll past the
bottom - which is default
if option is false, user cannot scroll further when bottom of file has
appeared in mainView
This commit is contained in:
KOREAN139
2018-11-08 19:35:05 +09:00
parent c2eaeab1f0
commit 9d79d32c94
3 changed files with 8 additions and 1 deletions

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