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,30 @@
|
||||
package keys
|
||||
|
||||
import (
|
||||
"charm.land/bubbles/v2/key"
|
||||
"github.com/anotherhadi/spilltea/internal/config"
|
||||
)
|
||||
|
||||
type ReplayKeyMap struct {
|
||||
Send key.Binding
|
||||
Edit key.Binding
|
||||
EditExt key.Binding
|
||||
UndoEdits key.Binding
|
||||
Delete key.Binding
|
||||
DeleteAll key.Binding
|
||||
}
|
||||
|
||||
func newReplayKeyMap(cfg config.ReplayKeys) ReplayKeyMap {
|
||||
return ReplayKeyMap{
|
||||
Send: binding(cfg.Send, "send"),
|
||||
Edit: binding(cfg.Edit, "edit"),
|
||||
EditExt: binding(cfg.EditExt, "edit in $EDITOR"),
|
||||
UndoEdits: binding(cfg.UndoEdits, "undo edits"),
|
||||
Delete: binding(cfg.Delete, "delete"),
|
||||
DeleteAll: binding(cfg.DeleteAll, "delete all"),
|
||||
}
|
||||
}
|
||||
|
||||
func (r ReplayKeyMap) Bindings() []key.Binding {
|
||||
return []key.Binding{r.Send, r.Edit, r.EditExt, r.UndoEdits, r.Delete, r.DeleteAll}
|
||||
}
|
||||
Reference in New Issue
Block a user