From 86dbd03c1ea6d4f2acffff473ca286703d714da8 Mon Sep 17 00:00:00 2001 From: Christian Rocha Date: Wed, 29 Jan 2020 21:51:52 -0500 Subject: [PATCH] Add ^K keybinding --- input/input.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/input/input.go b/input/input.go index fdd88c2..4d60705 100644 --- a/input/input.go +++ b/input/input.go @@ -57,6 +57,10 @@ func Update(msg tea.Msg, m Model) (Model, tea.Cmd) { case tea.KeyCtrlE: // ^E, end m.pos = len(m.Value) - 1 return m, nil + case tea.KeyCtrlK: // ^K, kill text after cursor + m.Value = m.Value[:m.pos] + m.pos = len(m.Value) + return m, nil case tea.KeyRune: m.Value = m.Value[:m.pos] + msg.String() + m.Value[m.pos:] m.pos++