gilo/editor/row.go

22 lines
231 B
Go

package editor
type row struct {
chars []rune
}
func NewRow(s string) *row {
var chars []rune
for _, ch := range s {
chars = append(chars, ch)
}
return &row {chars}
}
func (r *row) Size() int {
return len(r.chars)
}