1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

add scrollbars

This commit is contained in:
Jesse Duffield
2022-04-16 15:27:56 +10:00
parent b838b74801
commit e68093fe99
14 changed files with 270 additions and 116 deletions

View File

@ -98,21 +98,15 @@ func (gui *Gui) getManager(view *gocui.View) *tasks.ViewBufferManager {
},
func() {
// Need to check if the content of the view is well past the origin.
// It would be better to use .ViewLinesHeight here (given it considers
// wrapping) but when this function is called they haven't been written to yet.
linesHeight := view.LinesHeight()
_, height := view.Size()
linesHeight := view.ViewLinesHeight()
_, originY := view.Origin()
if linesHeight < originY {
newOriginY := linesHeight - height
if newOriginY < 0 {
newOriginY = 0
}
newOriginY := linesHeight
err := view.SetOrigin(0, newOriginY)
if err != nil {
panic(err)
}
}
view.FlushStaleCells()