1
0
mirror of https://github.com/br0xen/termbox-util.git synced 2024-11-25 23:03:13 +00:00

Fix Ctrl+U Behavior (Delete line before cursor)

This commit is contained in:
Brian Buller 2017-09-04 09:33:25 -05:00
parent 06481f40ee
commit de1d4c8338

View File

@ -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