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