mirror of
https://github.com/br0xen/termbox-util.git
synced 2024-11-26 07:03:14 +00:00
Fix Ctrl+U Behavior (Delete line before cursor)
This commit is contained in:
parent
06481f40ee
commit
de1d4c8338
@ -141,7 +141,7 @@ func (i *InputField) HandleEvent(event termbox.Event) bool {
|
|||||||
}
|
}
|
||||||
} else if event.Key == termbox.KeyCtrlU {
|
} else if event.Key == termbox.KeyCtrlU {
|
||||||
// Ctrl+U Clears the Input (before the cursor)
|
// Ctrl+U Clears the Input (before the cursor)
|
||||||
i.value = i.value[i.cursor:]
|
i.value = i.value[i.cursor+len(i.value):]
|
||||||
} else {
|
} else {
|
||||||
// Get the rune to add to our value. Space and Tab are special cases where
|
// Get the rune to add to our value. Space and Tab are special cases where
|
||||||
// we can't use the event's rune directly
|
// we can't use the event's rune directly
|
||||||
|
Loading…
Reference in New Issue
Block a user