mirror of
https://github.com/jesseduffield/lazydocker.git
synced 2026-07-21 23:01: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
|
||||
totalLines := mainView.LinesHeight()
|
||||
if oy+sizeY >= totalLines {
|
||||
if newOy := totalLines - sizeY; newOy > 0 {
|
||||
oy = newOy
|
||||
} else {
|
||||
scrollCount = 0
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
// 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
|
||||
sizeX, _ := mainView.Size()
|
||||
if ox+sizeX >= largestNumberOfCharacters {
|
||||
if largestNumberOfCharacters > sizeX {
|
||||
ox = largestNumberOfCharacters - sizeX
|
||||
} else {
|
||||
scrollCount = 0
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
return mainView.SetOrigin(ox+scrollCount, oy)
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue