func (s *Base) CommitVisualSelection() {
	if !s.HasVisualSelection() {
		return
	}
	for key := s.visualSelection[0]; key <= s.visualSelection[1]; key++ {
		selected := s.Selected(key)
		s.SetSelected(key, selected)
	}
}
CommitVisualSelection converts the visual selection to manual selection.
package list
import (
	"sort"
)
func (s *Base) ManuallySelected(i int) bool {
	_, ok := s.selection[i]
	return ok
}
func (s *Base) VisuallySelected(i int) bool {
	return s.visualSelection[0] <= i && i <= s.visualSelection[1]
}
func (s *Base) Selected(i int) bool {
	a := s.ManuallySelected(i)
	b := s.VisuallySelected(i)
	return (a || b) && a != b
}
func (s *Base) SelectionIndices() []int {
	selection := make([]int, 0, s.Len())
	max := s.Len()
	for i := 0; i < max; i++ {
		if s.Selected(i) {
			selection = append(selection, i)
		}
	}
	if len(selection) == 0 && s.Len() > 0 {
		selection = append(selection, s.Cursor())
	}
	selection = sort.IntSlice(selection)
	return selection
}
func (s *Base) SetSelected(i int, selected bool) {
	var x struct{}
	_, ok := s.selection[i]
	if ok == selected {
		return
	}
	if selected {
		s.selection[i] = x
	} else {
		delete(s.selection, i)
	}
}