2021-03-30 16:05:33 -04:00
|
|
|
package editor
|
|
|
|
|
|
|
|
type row struct {
|
|
|
|
chars []rune
|
|
|
|
}
|
|
|
|
|
2021-03-30 18:00:06 -04:00
|
|
|
func NewRow(s string) *row {
|
|
|
|
var chars []rune
|
|
|
|
|
|
|
|
for _, ch := range s {
|
|
|
|
chars = append(chars, ch)
|
|
|
|
}
|
|
|
|
|
|
|
|
return &row {chars}
|
2021-03-30 16:05:33 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
func (r *row) Size() int {
|
|
|
|
return len(r.chars)
|
|
|
|
}
|
|
|
|
|
|
|
|
|