4 "charm.land/bubbles/v2/key"
7type CommandsDialogKeyMap struct {
15func DefaultCommandsDialogKeyMap() CommandsDialogKeyMap {
16 return CommandsDialogKeyMap{
17 Select: key.NewBinding(
18 key.WithKeys("enter", "ctrl+y"),
19 key.WithHelp("enter", "confirm"),
22 key.WithKeys("down", "ctrl+n"),
23 key.WithHelp("↓", "next item"),
25 Previous: key.NewBinding(
26 key.WithKeys("up", "ctrl+p"),
27 key.WithHelp("↑", "previous item"),
31 key.WithHelp("tab", "switch selection"),
33 Close: key.NewBinding(
34 key.WithKeys("esc", "alt+esc"),
35 key.WithHelp("esc", "cancel"),
40// KeyBindings implements layout.KeyMapProvider
41func (k CommandsDialogKeyMap) KeyBindings() []key.Binding {
51// FullHelp implements help.KeyMap.
52func (k CommandsDialogKeyMap) FullHelp() [][]key.Binding {
53 m := [][]key.Binding{}
54 slice := k.KeyBindings()
55 for i := 0; i < len(slice); i += 4 {
56 end := min(i+4, len(slice))
57 m = append(m, slice[i:end])
62// ShortHelp implements help.KeyMap.
63func (k CommandsDialogKeyMap) ShortHelp() []key.Binding {
67 key.WithKeys("down", "up"),
68 key.WithHelp("↑↓", "choose"),
75type ArgumentsDialogKeyMap struct {
82func DefaultArgumentsDialogKeyMap() ArgumentsDialogKeyMap {
83 return ArgumentsDialogKeyMap{
84 Confirm: key.NewBinding(
85 key.WithKeys("enter"),
86 key.WithHelp("enter", "confirm"),
90 key.WithKeys("tab", "down"),
91 key.WithHelp("tab/↓", "next"),
93 Previous: key.NewBinding(
94 key.WithKeys("shift+tab", "up"),
95 key.WithHelp("shift+tab/↑", "previous"),
97 Close: key.NewBinding(
98 key.WithKeys("esc", "alt+esc"),
99 key.WithHelp("esc", "cancel"),
104// KeyBindings implements layout.KeyMapProvider
105func (k ArgumentsDialogKeyMap) KeyBindings() []key.Binding {
106 return []key.Binding{
114// FullHelp implements help.KeyMap.
115func (k ArgumentsDialogKeyMap) FullHelp() [][]key.Binding {
116 m := [][]key.Binding{}
117 slice := k.KeyBindings()
118 for i := 0; i < len(slice); i += 4 {
119 end := min(i+4, len(slice))
120 m = append(m, slice[i:end])
125// ShortHelp implements help.KeyMap.
126func (k ArgumentsDialogKeyMap) ShortHelp() []key.Binding {
127 return []key.Binding{
keysesc to close
- j k
- move down, up
- enter
- open
- esc
- back, or up a level
- 1 2 3 4
- readme, files, commits, refs
- /
- filter
- y
- copy the clone command
- c
- compare the chosen commit with another (or shift-click both)
- ?
- show or hide this list