peco.peco/selection.go
Daisuke Maki 586c36a0e7 Let us being the great refactor
* Move internal stuff to internal
* Properly use conditional compilation to detect Windows
* Move type declarations to one location (except for a few places still)
2015-09-28 21:39:43 +09:00

20 lines
443 B
Go

package peco
import "github.com/google/btree"
// NewSelection creates a new empty Selection
func NewSelection() *Selection {
return &Selection{btree.New(32)}
}
// Add adds a new line to the selection. If the line already
// exists in the selection, it is silently ignored
func (s *Selection) Add(l Line) {
s.ReplaceOrInsert(l)
}
// Remove removes the specified line from the selection
func (s *Selection) Remove(l Line) {
s.Delete(l)
}