mirror of
https://github.com/Maks1mS/bubbles.git
synced 2025-03-14 13:03:44 +03:00
Sort keybindings
This commit is contained in:
parent
2c07ebb669
commit
318f47a6aa
@ -82,20 +82,20 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
|
|||||||
m.pos--
|
m.pos--
|
||||||
}
|
}
|
||||||
return m, nil
|
return m, nil
|
||||||
case tea.KeyCtrlF: // ^F, forward one character
|
|
||||||
fallthrough
|
|
||||||
case tea.KeyLeft:
|
case tea.KeyLeft:
|
||||||
if m.pos > 0 {
|
if m.pos > 0 {
|
||||||
m.pos--
|
m.pos--
|
||||||
}
|
}
|
||||||
return m, nil
|
return m, nil
|
||||||
case tea.KeyCtrlB: // ^B, back one charcter
|
|
||||||
fallthrough
|
|
||||||
case tea.KeyRight:
|
case tea.KeyRight:
|
||||||
if m.pos < len(m.Value) {
|
if m.pos < len(m.Value) {
|
||||||
m.pos++
|
m.pos++
|
||||||
}
|
}
|
||||||
return m, nil
|
return m, nil
|
||||||
|
case tea.KeyCtrlF: // ^F, forward one character
|
||||||
|
fallthrough
|
||||||
|
case tea.KeyCtrlB: // ^B, back one charcter
|
||||||
|
fallthrough
|
||||||
case tea.KeyCtrlA: // ^A, beginning
|
case tea.KeyCtrlA: // ^A, beginning
|
||||||
m.pos = 0
|
m.pos = 0
|
||||||
return m, nil
|
return m, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user