From 127afac006b086e035339d6aa24c1edf7866ea22 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 29 Jan 2020 22:19:47 -0500 Subject: [PATCH] Add ^D to delete character under cursor --- input/input.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/input/input.go b/input/input.go index de3d2cd..09952a3 100644 --- a/input/input.go +++ b/input/input.go @@ -56,6 +56,11 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) { case tea.KeyCtrlA: // ^A, beginning m.pos = 0 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 m.pos = len(m.Value) - 1 return m, nil