Skip to content

Commit

Permalink
Replace keymaps
Browse files Browse the repository at this point in the history
  • Loading branch information
canack committed Jan 2, 2024
1 parent dcbd9ae commit 115bd3c
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions internal/terminal/handler/ghrepository/keymap.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ var keys = keyMap{
teakey.WithHelp("enter", "Launch the selected option"),
),
TabSwitch: teakey.NewBinding(
teakey.WithKeys("ctrl+left", "ctrl+right"),
teakey.WithHelp("ctrl + (← | →)", "switch tab"),
teakey.WithKeys("shift+left", "shift+right"),
teakey.WithHelp("shift + (← | →)", "switch tab"),
),
}

Expand Down
4 changes: 2 additions & 2 deletions internal/terminal/handler/ghtrigger/keymap.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func (k keyMap) FullHelp() [][]teakey.Binding {

var keys = keyMap{
PreviousTab: teakey.NewBinding(
teakey.WithKeys("ctrl+left"),
teakey.WithHelp("ctrl + ←", "previous tab"),
teakey.WithKeys("shift+left"),
teakey.WithHelp("shift + ←", "previous tab"),
),
Refresh: teakey.NewBinding(
teakey.WithKeys("ctrl+r", "ctrl+R"),
Expand Down
4 changes: 2 additions & 2 deletions internal/terminal/handler/ghworkflow/keymap.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ func (k keyMap) FullHelp() [][]teakey.Binding {

var keys = keyMap{
TabSwitch: teakey.NewBinding(
teakey.WithKeys("ctrl+left", "ctrl+right"),
teakey.WithHelp("ctrl + (← | →)", "switch tab"),
teakey.WithKeys("shift+left", "shift+right"),
teakey.WithHelp("shift + (← | →)", "switch tab"),
),
}

Expand Down
4 changes: 2 additions & 2 deletions internal/terminal/handler/ghworkflowhistory/keymap.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ var keys = keyMap{
teakey.WithHelp("enter", "Launch the selected option"),
),
TabSwitch: teakey.NewBinding(
teakey.WithKeys("ctrl+left", "ctrl+right"),
teakey.WithHelp("ctrl + (← | →)", "switch tab"),
teakey.WithKeys("shift+left", "shift+right"),
teakey.WithHelp("shift + (← | →)", "switch tab"),
),
}

Expand Down
4 changes: 2 additions & 2 deletions internal/terminal/handler/handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ func (m *model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch msg := msg.(type) {
case tea.KeyMsg:
switch keypress := msg.String(); keypress {
case "ctrl+left":
case "shift+left":
*m.currentTab = max(*m.currentTab-1, 0)
cmds = append(cmds, m.handleTabContent(cmd, msg))
case "ctrl+right":
case "shift+right":
*m.currentTab = min(*m.currentTab+1, len(m.TabsWithColor)-1)
cmds = append(cmds, m.handleTabContent(cmd, msg))
case "enter":
Expand Down
4 changes: 2 additions & 2 deletions internal/terminal/handler/information/keymap.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ func (k keyMap) FullHelp() [][]teakey.Binding {

var keys = keyMap{
NextTab: teakey.NewBinding(
teakey.WithKeys("ctrl+right"),
teakey.WithHelp("ctrl + →", "next tab"),
teakey.WithKeys("shift+right"),
teakey.WithHelp("shift + →", "next tab"),
),
Quit: teakey.NewBinding(
teakey.WithKeys("q", "ctrl+c"),
Expand Down

0 comments on commit 115bd3c

Please sign in to comment.