diff --git a/pkg/gui/editors.go b/pkg/gui/editors.go index a409e64f50d..6345c93cf15 100644 --- a/pkg/gui/editors.go +++ b/pkg/gui/editors.go @@ -8,6 +8,9 @@ import ( func (gui *Gui) handleEditorKeypress(textArea *gocui.TextArea, key gocui.Key, ch rune, mod gocui.Modifier, allowMultiline bool) bool { switch { + case (key == gocui.KeyBackspace || key == gocui.KeyBackspace2) && (mod&gocui.ModAlt) != 0, + key == gocui.KeyCtrlW: + textArea.BackSpaceWord() case key == gocui.KeyBackspace || key == gocui.KeyBackspace2: textArea.BackSpaceChar() case key == gocui.KeyCtrlD || key == gocui.KeyDelete: @@ -42,8 +45,6 @@ func (gui *Gui) handleEditorKeypress(textArea *gocui.TextArea, key gocui.Key, ch textArea.GoToStartOfLine() case key == gocui.KeyCtrlE || key == gocui.KeyEnd: textArea.GoToEndOfLine() - case key == gocui.KeyCtrlW: - textArea.BackSpaceWord() case key == gocui.KeyCtrlY: textArea.Yank()