IndexOfSelection returns the position of the first node in the specified Selection object within this Selection object, or -1 if not found.
(sel *Selection)
| 123 | // IndexOfSelection returns the position of the first node in the specified |
| 124 | // Selection object within this Selection object, or -1 if not found. |
| 125 | func (s *Selection) IndexOfSelection(sel *Selection) int { |
| 126 | if sel != nil && len(sel.Nodes) > 0 { |
| 127 | return indexInSlice(s.Nodes, sel.Nodes[0]) |
| 128 | } |
| 129 | return -1 |
| 130 | } |