mirror of
https://github.com/Maks1mS/bubbles.git
synced 2024-12-25 07:04:37 +03:00
Add ^D to delete character under cursor
This commit is contained in:
parent
3ac2b4881b
commit
127afac006
@ -56,6 +56,11 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) {
|
|||||||
case tea.KeyCtrlA: // ^A, beginning
|
case tea.KeyCtrlA: // ^A, beginning
|
||||||
m.pos = 0
|
m.pos = 0
|
||||||
return m, nil
|
return m, nil
|
||||||
|
case tea.KeyCtrlD: // ^D, delete char under cursor
|
||||||
|
if len(m.Value) > 0 && m.pos < len(m.Value) {
|
||||||
|
m.Value = m.Value[:m.pos] + m.Value[m.pos+1:]
|
||||||
|
}
|
||||||
|
return m, nil
|
||||||
case tea.KeyCtrlE: // ^E, end
|
case tea.KeyCtrlE: // ^E, end
|
||||||
m.pos = len(m.Value) - 1
|
m.pos = len(m.Value) - 1
|
||||||
return m, nil
|
return m, nil
|
||||||
|
Loading…
Reference in New Issue
Block a user