Received: from git.sr.ht (unknown [173.195.146.142]) by mail-b.sr.ht (Postfix) with ESMTPSA id 0A3E0FF187 for <~adnano/astronaut-devel@lists.sr.ht>; Mon, 9 Nov 2020 22:05:01 +0000 (UTC) From: ~exastencil Date: Mon, 09 Nov 2020 23:54:03 +0200 Subject: [PATCH astronaut 1/1] Vim-familiar keybindings for line scrolling Message-ID: <160495950073.15813.14935779136067873315-1@git.sr.ht> X-Mailer: git.sr.ht Reply-to: ~exastencil In-Reply-To: <160495950073.15813.14935779136067873315-0@git.sr.ht> To: ~adnano/astronaut-devel@lists.sr.ht Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 From: Exa Stencil --- ui/context.go | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/ui/context.go b/ui/context.go index 93e3a49..70106c1 100644 --- a/ui/context.go +++ b/ui/context.go @@ -166,6 +166,17 @@ func (c Context) HandleScrollEvent(event tcell.Event) bo= ol { c.PgUp() c.Invalidate() return true + case tcell.KeyRune: + switch event.Rune() { + case 'j': + c.ScrollDown(1) + c.Invalidate() + return true + case 'k': + c.ScrollUp(1) + c.Invalidate() + return true + } } case *tcell.EventMouse: if !c.Contains(event.Position()) { --=20 2.26.2