4 "github.com/gdamore/tcell"
8 // Statusline represents the blue line at the bottom of the
9 // editor that gives information about the buffer
10 type Statusline struct {
14 // Display draws the statusline to the screen
15 func (sl *Statusline) Display() {
22 if sl.v.buf.text != sl.v.buf.savedText {
25 file += " (" + strconv.Itoa(sl.v.cursor.y+1) + "," + strconv.Itoa(sl.v.cursor.GetVisualX()+1) + ")"
26 filetype := sl.v.buf.filetype
27 file += " " + filetype
29 statusLineStyle := tcell.StyleDefault.Reverse(true)
31 for x := 0; x < sl.v.width; x++ {
33 sl.v.s.SetContent(x, y, []rune(file)[x], nil, statusLineStyle)
34 // } else if x > sl.v.width-Count(filetype)-1 {
35 // sl.v.s.SetContent(x, y, []rune(filetype)[Count(filetype)-(sl.v.width-1-x)-1], nil, statusLineStyle)
37 sl.v.s.SetContent(x, y, ' ', nil, statusLineStyle)