summaryrefslogtreecommitdiff
path: root/ui/ui.go
diff options
context:
space:
mode:
authorAlexey Yerin <yyp@disroot.org>2021-04-26 13:18:01 +0300
committerHubert Hirtz <hubert@hirtz.pm>2021-04-26 22:41:06 +0200
commita7f7c5ad40a3f6960ba61e67f737ddef56408d6e (patch)
tree1b41942c6614087f862d193f654a33fb1c47cf45 /ui/ui.go
parentDon't show own typing notifications (diff)
editor: add ^W delete word binding
It allows to delete the current word (any string of characters until a space). Also, all spaces at the start are cleared to allow doing something like: Hello world| Hello | <- the cursor is at a space | <- nothing left
Diffstat (limited to 'ui/ui.go')
-rw-r--r--ui/ui.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/ui/ui.go b/ui/ui.go
index e527f8e..50ddab5 100644
--- a/ui/ui.go
+++ b/ui/ui.go
@@ -192,6 +192,10 @@ func (ui *UI) InputDelete() (ok bool) {
return ui.e.RemRuneForward()
}
+func (ui *UI) InputDeleteWord() (ok bool) {
+ return ui.e.RemWord()
+}
+
func (ui *UI) InputAutoComplete(offset int) (ok bool) {
return ui.e.AutoComplete(offset)
}