mirror of
https://github.com/peco/peco.git
synced 2026-09-15 01:36:15 -04:00
* Move internal stuff to internal * Properly use conditional compilation to detect Windows * Move type declarations to one location (except for a few places still)
20 lines
443 B
Go
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)
|
|
}
|