]> git.lizzy.rs Git - micro.git/blobdiff - cmd/micro/scrollbar.go
Code optimisation (#1117)
[micro.git] / cmd / micro / scrollbar.go
index 1310112b270d0742d8724cfe8a5f251240b330dc..f4a9a0786744f59b7484115e486f23b9ae1fa928 100644 (file)
@@ -1,15 +1,17 @@
 package main
 
+// ScrollBar represents an optional scrollbar that can be used
 type ScrollBar struct {
        view *View
 }
 
+// Display shows the scrollbar
 func (sb *ScrollBar) Display() {
        style := defStyle.Reverse(true)
-       screen.SetContent(sb.view.x+sb.view.Width-1, sb.view.y+sb.Pos(), ' ', nil, style)
+       screen.SetContent(sb.view.x+sb.view.Width-1, sb.view.y+sb.pos(), ' ', nil, style)
 }
 
-func (sb *ScrollBar) Pos() int {
+func (sb *ScrollBar) pos() int {
        numlines := sb.view.Buf.NumLines
        h := sb.view.Height
        filepercent := float32(sb.view.Topline) / float32(numlines)