Proper scrollbar location for hsplits

This commit is contained in:
Zachary Yedidia 2019-12-21 16:19:20 -05:00
parent 9127152d93
commit 88b8fc713d

View file

@ -651,7 +651,7 @@ func (w *BufWindow) displayScrollBar() {
if barsize < 1 {
barsize = 1
}
barstart := int(float64(w.StartLine) / float64(w.Buf.LinesNum()) * float64(w.Height))
barstart := w.Y + int(float64(w.StartLine)/float64(w.Buf.LinesNum())*float64(w.Height))
for y := barstart; y < util.Min(barstart+barsize, w.Y+bufHeight); y++ {
screen.Screen.SetContent(scrollX, y, '|', nil, config.DefStyle.Reverse(true))
}