Add 'scrollbarchar' option (#2342)

This lets you specify a character that will get used for rendering the
scrollbar.

Co-authored-by: Zachary Yedidia <zyedidia@gmail.com>
This commit is contained in:
Christian Muehlhaeuser
2023-07-08 23:02:01 +02:00
committed by GitHub
parent 9593c2a720
commit ffa7f987b6
3 changed files with 14 additions and 1 deletions

View File

@@ -767,8 +767,14 @@ func (w *BufWindow) displayScrollBar() {
scrollBarStyle = style
}
scrollBarChar := config.GetGlobalOption("scrollbarchar").(string)
if util.CharacterCountInString(scrollBarChar) != 1 {
scrollBarChar = "|"
}
scrollBarRune := []rune(scrollBarChar)
for y := barstart; y < util.Min(barstart+barsize, w.Y+w.bufHeight); y++ {
screen.SetContent(scrollX, y, '|', nil, scrollBarStyle)
screen.SetContent(scrollX, y, scrollBarRune[0], nil, scrollBarStyle)
}
}
}