// Find a visual offset for a given cursor
Find a visual offset for a given cursor
// Find a visual offset for a given cursor
func (c *cursor_location) voffset() (vo int) {
	data := c.line.data[:c.boffset]
	for len(data) > 0 {
		r, rlen := utf8.DecodeRune(data)
		data = data[rlen:]
		vo += rune_advance_len(r, vo)
	}
	return
}
func ( c * cursor_location ) voffset ( ) ( vo int ) { data := c . line . data [ : c . boffset ] for len ( data ) > 0 { r , rlen := utf8 . DecodeRune ( data ) data = data [ rlen : ] vo += rune_advance_len ( r , vo ) } return }
Find a visual offset for a given cursor
Find a visual offset for a given cursor