// Prev turns to the previous position on the cursor c.
// It returns nil at the start on the cursor c.
Prev turns to the previous position on the cursor c.
It returns nil at the start on the cursor c.
// Prev turns to the previous position on the cursor c . // It returns nil at the start on the cursor c .
func (c *Cursor) Prev() *Position {
	n := c.curr.cmp(&c.start)
	if n == 0 {
		if c.pi == 0 {
			return nil
		}
		c.pi--
		if c.ps[c.pi].IP.To4() != nil {
			c.curr = c.ps[c.pi].lastIPv4MappedIPv6Int()
			c.end = c.curr
		}
		if c.ps[c.pi].IP.To16() != nil && c.ps[c.pi].IP.To4() == nil {
			c.curr = c.ps[c.pi].lastIPv6Int()
			c.end = c.curr
		}
		c.start = ipToIPv6Int(c.ps[c.pi].IP.To16())
	} else {
		c.curr.decr()
	}
	return c.Pos()
}
func ( c * Cursor ) Prev ( ) * Position { n := c . curr . cmp ( & c . start ) if n == 0 { if c . pi == 0 { return nil } c . pi -- if c . ps [ c . pi ] . IP . To4 ( ) != nil { c . curr = c . ps [ c . pi ] . lastIPv4MappedIPv6Int ( ) c . end = c . curr } if c . ps [ c . pi ] . IP . To16 ( ) != nil && c . ps [ c . pi ] . IP . To4 ( ) == nil { c . curr = c . ps [ c . pi ] . lastIPv6Int ( ) c . end = c . curr } c . start = ipToIPv6Int ( c . ps [ c . pi ] . IP . To16 ( ) ) } else { c . curr . decr ( ) } return c . Pos ( ) }
Prev turns to the previous position on the cursor c.
It returns nil at the start on the cursor c.
Prev turns to the previous position on the cursor c . It returns nil at the start on the cursor c .