From 84372cfad927b2cead6eb2c8e6fcf363ec2d0f9d Mon Sep 17 00:00:00 2001 From: Ching Pei Yang Date: Mon, 14 Aug 2023 21:33:11 +0200 Subject: [PATCH] Add emacs-keybinds for word navigation --- pkg/gui/editors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/pkg/gui/editors.go b/pkg/gui/editors.go index fdbe67a39..69aabd684 100644 --- a/pkg/gui/editors.go +++ b/pkg/gui/editors.go @@ -16,11 +16,11 @@ 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: + case (key == gocui.KeyArrowLeft || ch == 'b') && (mod&gocui.ModAlt) != 0: textArea.MoveLeftWord() case key == gocui.KeyArrowLeft || key == gocui.KeyCtrlB: textArea.MoveCursorLeft() - case key == gocui.KeyArrowRight && (mod&gocui.ModAlt) != 0: + case (key == gocui.KeyArrowRight || ch == 'f') && (mod&gocui.ModAlt) != 0: textArea.MoveRightWord() case key == gocui.KeyArrowRight || key == gocui.KeyCtrlF: textArea.MoveCursorRight()