9
9
"github.com/opencode-ai/opencode/internal/tui/layout"
10
10
"github.com/opencode-ai/opencode/internal/tui/styles"
11
11
"github.com/opencode-ai/opencode/internal/tui/util"
12
+ "github.com/opencode-ai/opencode/internal/tui/config"
12
13
)
13
14
14
15
const question = "Are you sure you want to quit?"
@@ -32,27 +33,34 @@ type helpMapping struct {
32
33
Tab key.Binding
33
34
}
34
35
35
- var helpKeys = helpMapping {
36
- LeftRight : key .NewBinding (
37
- key .WithKeys ("left" , "right" ),
38
- key .WithHelp ("←/→" , "switch options" ),
39
- ),
40
- EnterSpace : key .NewBinding (
41
- key .WithKeys ("enter" , " " ),
42
- key .WithHelp ("enter/space" , "confirm" ),
43
- ),
44
- Yes : key .NewBinding (
45
- key .WithKeys ("y" , "Y" ),
46
- key .WithHelp ("y/Y" , "yes" ),
47
- ),
48
- No : key .NewBinding (
49
- key .WithKeys ("n" , "N" ),
50
- key .WithHelp ("n/N" , "no" ),
51
- ),
52
- Tab : key .NewBinding (
53
- key .WithKeys ("tab" ),
54
- key .WithHelp ("tab" , "switch options" ),
55
- ),
36
+ func NewHelpMapping (hotkeys config.HotkeyConfig ) helpMapping {
37
+ return helpMapping {
38
+ LeftRight : config .GetKeyBinding (
39
+ hotkeys .Left + "," + hotkeys .Right ,
40
+ "←/→" ,
41
+ "switch options" ,
42
+ ),
43
+ EnterSpace : config .GetKeyBinding (
44
+ hotkeys .Enter + ",space" ,
45
+ "enter/space" ,
46
+ "confirm" ,
47
+ ),
48
+ Yes : config .GetKeyBinding (
49
+ "y,Y" ,
50
+ "y/Y" ,
51
+ "yes" ,
52
+ ),
53
+ No : config .GetKeyBinding (
54
+ "n,N" ,
55
+ "n/N" ,
56
+ "no" ,
57
+ ),
58
+ Tab : config .GetKeyBinding (
59
+ hotkeys .Tab ,
60
+ hotkeys .Tab ,
61
+ "switch options" ,
62
+ ),
63
+ }
56
64
}
57
65
58
66
func (q * quitDialogCmp ) Init () tea.Cmd {
0 commit comments