From e436922eb60771130f4a6c6222f46b41ccb62022 Mon Sep 17 00:00:00 2001 From: Ryooooooga Date: Wed, 5 Oct 2022 22:29:51 +0900 Subject: [PATCH] feat(editors.go): move by words --- pkg/gui/editors.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/gui/editors.go b/pkg/gui/editors.go index 20223d117..9e00f8351 100644 --- a/pkg/gui/editors.go +++ b/pkg/gui/editors.go @@ -22,8 +22,12 @@ func (gui *Gui) handleEditorKeypress(textArea *gocui.TextArea, key gocui.Key, ch textArea.MoveCursorDown() case key == gocui.KeyArrowUp: textArea.MoveCursorUp() + case key == gocui.KeyArrowLeft && (mod&gocui.ModAlt) != 0: + textArea.MoveLeftWord() case key == gocui.KeyArrowLeft || key == gocui.KeyCtrlB: textArea.MoveCursorLeft() + case key == gocui.KeyArrowRight && (mod&gocui.ModAlt) != 0: + textArea.MoveRightWord() case key == gocui.KeyArrowRight || key == gocui.KeyCtrlF: textArea.MoveCursorRight() case key == newlineKey: