mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-05-20 17:52:33 +02:00
85c2806604
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
27 lines
648 B
Go
27 lines
648 B
Go
package keys
|
|
|
|
import (
|
|
"charm.land/bubbles/v2/key"
|
|
"github.com/anotherhadi/spilltea/internal/config"
|
|
)
|
|
|
|
type DocsKeyMap struct {
|
|
Search key.Binding
|
|
SearchReset key.Binding
|
|
SearchNext key.Binding
|
|
SearchPrev key.Binding
|
|
}
|
|
|
|
func newDocsKeyMap(cfg config.DocsKeys) DocsKeyMap {
|
|
return DocsKeyMap{
|
|
Search: binding(cfg.Search, "search"),
|
|
SearchReset: binding(cfg.SearchReset, "reset search"),
|
|
SearchNext: binding(cfg.SearchNext, "next match"),
|
|
SearchPrev: binding(cfg.SearchPrev, "prev match"),
|
|
}
|
|
}
|
|
|
|
func (d DocsKeyMap) Bindings() []key.Binding {
|
|
return []key.Binding{d.Search, d.SearchReset, d.SearchNext, d.SearchPrev}
|
|
}
|