From de1d4c83380ebcfec0be0943384867902498036d Mon Sep 17 00:00:00 2001 From: Brian Buller Date: Mon, 4 Sep 2017 09:33:25 -0500 Subject: [PATCH] Fix Ctrl+U Behavior (Delete line before cursor) --- termbox_inputfield.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/termbox_inputfield.go b/termbox_inputfield.go index 01db0df..671eb96 100644 --- a/termbox_inputfield.go +++ b/termbox_inputfield.go @@ -141,7 +141,7 @@ func (i *InputField) HandleEvent(event termbox.Event) bool { } } else if event.Key == termbox.KeyCtrlU { // Ctrl+U Clears the Input (before the cursor) - i.value = i.value[i.cursor:] + i.value = i.value[i.cursor+len(i.value):] } else { // Get the rune to add to our value. Space and Tab are special cases where // we can't use the event's rune directly