mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01:03 +00:00
scrollDownMain now works properly with ScrollPastBottom enabled #31
This commit is contained in:
parent
b899796a52
commit
4e25f78507
1 changed files with 6 additions and 7 deletions
|
|
@ -16,21 +16,20 @@ func (gui *Gui) scrollUpMain(g *gocui.Gui, v *gocui.View) error {
|
|||
|
||||
func (gui *Gui) scrollDownMain(g *gocui.Gui, v *gocui.View) error {
|
||||
mainView := gui.getMainView()
|
||||
mainView.Autoscroll = false
|
||||
ox, oy := mainView.Origin()
|
||||
y := oy
|
||||
|
||||
reservedLines := 0
|
||||
if !gui.Config.UserConfig.Gui.ScrollPastBottom {
|
||||
_, sy := mainView.Size()
|
||||
y += sy
|
||||
_, sizeY := mainView.Size()
|
||||
reservedLines = sizeY
|
||||
}
|
||||
|
||||
_, sizeY := mainView.Size()
|
||||
totalLines := mainView.ViewLinesHeight()
|
||||
if oy+sizeY >= totalLines {
|
||||
if oy+reservedLines >= totalLines {
|
||||
return nil
|
||||
}
|
||||
|
||||
// for some reason we can't work out whether we've hit the bottomq
|
||||
// there is a large discrepancy in the origin's y value and the length of BufferLines
|
||||
return mainView.SetOrigin(ox, oy+gui.Config.UserConfig.Gui.ScrollHeight)
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue