mirror of
https://github.com/anotherhadi/spilltea.git
synced 2026-05-20 01:32:33 +02:00
Init
Signed-off-by: Hadi <112569860+anotherhadi@users.noreply.github.com>
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package keys
|
||||
|
||||
import (
|
||||
"charm.land/bubbles/v2/key"
|
||||
"github.com/anotherhadi/spilltea/internal/config"
|
||||
)
|
||||
|
||||
type HistoryKeyMap struct {
|
||||
DeleteEntry key.Binding
|
||||
DeleteAll key.Binding
|
||||
Filter key.Binding
|
||||
SqlQuery key.Binding
|
||||
}
|
||||
|
||||
func newHistoryKeyMap(cfg config.HistoryKeys) HistoryKeyMap {
|
||||
return HistoryKeyMap{
|
||||
DeleteEntry: binding(cfg.DeleteEntry, "delete entry"),
|
||||
DeleteAll: binding(cfg.DeleteAll, "delete all"),
|
||||
Filter: binding(cfg.Filter, "filter"),
|
||||
SqlQuery: binding(cfg.SqlQuery, "sql query"),
|
||||
}
|
||||
}
|
||||
|
||||
func (h HistoryKeyMap) Bindings() []key.Binding {
|
||||
return []key.Binding{h.DeleteEntry, h.DeleteAll}
|
||||
}
|
||||
Reference in New Issue
Block a user