+func (w *BufWindow) displayScrollBar() {
+ if w.Buf.Settings["scrollbar"].(bool) && w.Buf.LinesNum() > w.Height {
+ scrollX := w.X + w.Width - 1
+ bufHeight := w.Height
+ if w.drawStatus {
+ bufHeight--
+ }
+ barsize := int(float64(w.Height) / float64(w.Buf.LinesNum()) * float64(w.Height))
+ if barsize < 1 {
+ barsize = 1
+ }
+ 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.SetContent(scrollX, y, '|', nil, config.DefStyle.Reverse(true))
+ }
+ }
+}
+