]> git.lizzy.rs Git - micro.git/blobdiff - statusline.go
Add comment fix go style
[micro.git] / statusline.go
index a7529d6d66707819b2b22ac79b1e48ba15caa09f..8ca1e1d38ebbcea837ccd06f458e81bd9d63c5ac 100644 (file)
@@ -5,11 +5,14 @@ import (
        "strconv"
 )
 
+// Statusline represents the blue line at the bottom of the
+// editor that gives information about the buffer
 type Statusline struct {
        v *View
 }
 
-func (sl *Statusline) display() {
+// Display draws the statusline to the screen
+func (sl *Statusline) Display() {
        y := sl.v.height
 
        file := sl.v.buf.name
@@ -19,12 +22,12 @@ func (sl *Statusline) display() {
        if sl.v.buf.text != sl.v.buf.savedText {
                file += " +"
        }
-       file += " (" + strconv.Itoa(sl.v.cursor.y+1) + "," + strconv.Itoa(sl.v.cursor.getVisualX()+1) + ")"
+       file += " (" + strconv.Itoa(sl.v.cursor.y+1) + "," + strconv.Itoa(sl.v.cursor.GetVisualX()+1) + ")"
 
        statusLineStyle := tcell.StyleDefault.Background(tcell.ColorNavy).Foreground(tcell.ColorBlack)
 
        for x := 0; x < sl.v.width; x++ {
-               if x < count(file) {
+               if x < Count(file) {
                        sl.v.s.SetContent(x, y, []rune(file)[x], nil, statusLineStyle)
                } else {
                        sl.v.s.SetContent(x, y, ' ', nil, statusLineStyle)