From 82acaacb15e5da69c9103894d05c5af72e848c5f Mon Sep 17 00:00:00 2001 From: delthas Date: Fri, 15 Apr 2022 23:51:14 +0200 Subject: Delete word on Alt+Backspace This is a standard shortcut. --- app.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app.go b/app.go index e6a7b4b..421b569 100644 --- a/app.go +++ b/app.go @@ -547,7 +547,12 @@ func (app *App) handleKeyEvent(ev *tcell.EventKey) { app.win.InputEnd() } case tcell.KeyBackspace, tcell.KeyBackspace2: - ok := app.win.InputBackspace() + var ok bool + if ev.Modifiers() == tcell.ModAlt { + ok = app.win.InputDeleteWord() + } else { + ok = app.win.InputBackspace() + } if ok { app.typing() } -- cgit v1.2.3