mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-25 08:31:03 +00:00
implemented review comments by adding improved scrolling checking #31
This commit is contained in:
parent
42e69ac821
commit
07bfb9255e
1 changed files with 2 additions and 10 deletions
|
|
@ -27,11 +27,7 @@ func (gui *Gui) scrollDownMain(g *gocui.Gui, v *gocui.View) error {
|
||||||
scrollCount := gui.Config.UserConfig.Gui.ScrollHeight
|
scrollCount := gui.Config.UserConfig.Gui.ScrollHeight
|
||||||
totalLines := mainView.LinesHeight()
|
totalLines := mainView.LinesHeight()
|
||||||
if oy+sizeY >= totalLines {
|
if oy+sizeY >= totalLines {
|
||||||
if newOy := totalLines - sizeY; newOy > 0 {
|
return nil
|
||||||
oy = newOy
|
|
||||||
} else {
|
|
||||||
scrollCount = 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// for some reason we can't work out whether we've hit the bottomq
|
// for some reason we can't work out whether we've hit the bottomq
|
||||||
|
|
@ -62,11 +58,7 @@ func (gui *Gui) scrollRightMain(g *gocui.Gui, v *gocui.View) error {
|
||||||
scrollCount := gui.Config.UserConfig.Gui.ScrollHeight
|
scrollCount := gui.Config.UserConfig.Gui.ScrollHeight
|
||||||
sizeX, _ := mainView.Size()
|
sizeX, _ := mainView.Size()
|
||||||
if ox+sizeX >= largestNumberOfCharacters {
|
if ox+sizeX >= largestNumberOfCharacters {
|
||||||
if largestNumberOfCharacters > sizeX {
|
return nil
|
||||||
ox = largestNumberOfCharacters - sizeX
|
|
||||||
} else {
|
|
||||||
scrollCount = 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return mainView.SetOrigin(ox+scrollCount, oy)
|
return mainView.SetOrigin(ox+scrollCount, oy)
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue