1
0
mirror of https://github.com/mrusme/neonmodem.git synced 2024-06-16 06:25:23 +00:00

Removed unnecessary key bindings

This commit is contained in:
マリウス 2022-12-30 21:15:14 -05:00
parent 2c3a560fec
commit eef638d3aa
No known key found for this signature in database
GPG Key ID: 272ED814BF63261F

120
ui/ui.go
View File

@ -37,66 +37,6 @@ type KeyMap struct {
}
var DefaultKeyMap = KeyMap{
FirstTab: key.NewBinding(
key.WithKeys("f1"),
key.WithHelp("f1", "first tab"),
),
SecondTab: key.NewBinding(
key.WithKeys("f2"),
key.WithHelp("f2", "second tab"),
),
ThirdTab: key.NewBinding(
key.WithKeys("f3"),
key.WithHelp("f3", "third tab"),
),
FourthTab: key.NewBinding(
key.WithKeys("f4"),
key.WithHelp("f4", "fourth tab"),
),
FifthTab: key.NewBinding(
key.WithKeys("f5"),
key.WithHelp("f5", "fifth tab"),
),
SixthTab: key.NewBinding(
key.WithKeys("f6"),
key.WithHelp("f6", "sixth tab"),
),
SeventhTab: key.NewBinding(
key.WithKeys("f7"),
key.WithHelp("f7", "seventh tab"),
),
EightTab: key.NewBinding(
key.WithKeys("f8"),
key.WithHelp("f8", "eight tab"),
),
NinthTab: key.NewBinding(
key.WithKeys("f9"),
key.WithHelp("f9", "ninth tab"),
),
TenthTab: key.NewBinding(
key.WithKeys("f10"),
key.WithHelp("f10", "tenth tab"),
),
EleventhTab: key.NewBinding(
key.WithKeys("f11"),
key.WithHelp("f11", "eleventh tab"),
),
TwelfthTab: key.NewBinding(
key.WithKeys("f12"),
key.WithHelp("f12", "twelfth tab"),
),
ThirteenthTab: key.NewBinding(
key.WithKeys("f13"),
key.WithHelp("f13", "thirteenth tab"),
),
PrevTab: key.NewBinding(
key.WithKeys("ctrl+p"),
key.WithHelp("ctrl+p", "previous tab"),
),
NextTab: key.NewBinding(
key.WithKeys("ctrl+n"),
key.WithHelp("ctrl+n", "next tab"),
),
Up: key.NewBinding(
key.WithKeys("k", "up"),
key.WithHelp("↑/k", "move up"),
@ -151,66 +91,6 @@ func (m Model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
switch {
case key.Matches(msg, m.keymap.Quit):
return m, tea.Quit
case key.Matches(msg, m.keymap.FirstTab):
m.nav.NthTab(1)
return m, nil
case key.Matches(msg, m.keymap.SecondTab):
m.nav.NthTab(2)
return m, nil
case key.Matches(msg, m.keymap.ThirdTab):
m.nav.NthTab(3)
return m, nil
case key.Matches(msg, m.keymap.FourthTab):
m.nav.NthTab(4)
return m, nil
case key.Matches(msg, m.keymap.FifthTab):
m.nav.NthTab(5)
return m, nil
case key.Matches(msg, m.keymap.SixthTab):
m.nav.NthTab(6)
return m, nil
case key.Matches(msg, m.keymap.SeventhTab):
m.nav.NthTab(7)
return m, nil
case key.Matches(msg, m.keymap.EightTab):
m.nav.NthTab(8)
return m, nil
case key.Matches(msg, m.keymap.NinthTab):
m.nav.NthTab(9)
return m, nil
case key.Matches(msg, m.keymap.TenthTab):
m.nav.NthTab(10)
return m, nil
case key.Matches(msg, m.keymap.EleventhTab):
m.nav.NthTab(11)
return m, nil
case key.Matches(msg, m.keymap.TwelfthTab):
m.nav.NthTab(12)
return m, nil
case key.Matches(msg, m.keymap.ThirteenthTab):
m.nav.NthTab(13)
return m, nil
case key.Matches(msg, m.keymap.PrevTab):
m.nav.PrevTab()
return m, nil
case key.Matches(msg, m.keymap.NextTab):
m.nav.NextTab()
return m, nil
}
case tea.WindowSizeMsg: