mirror of
https://github.com/peco/peco.git
synced 2026-09-10 07:16:29 -04:00
20 lines
282 B
Go
20 lines
282 B
Go
package peco
|
|
|
|
func (c *Caret) Pos() int {
|
|
c.mutex.Lock()
|
|
defer c.mutex.Unlock()
|
|
return c.pos
|
|
}
|
|
|
|
func (c *Caret) SetPos(p int) {
|
|
c.mutex.Lock()
|
|
defer c.mutex.Unlock()
|
|
c.pos = p
|
|
}
|
|
|
|
func (c *Caret) Move(diff int) {
|
|
c.mutex.Lock()
|
|
defer c.mutex.Unlock()
|
|
c.pos = c.pos + diff
|
|
}
|