- commit
- 59eee85
- parent
- fb80320
- author
- Eric Bower
- date
- 2025-03-12 12:23:03 -0400 EDT
feat(tui): support arrow keys for navigation
3 files changed,
+5,
-3
M
go.mod
+1,
-1
1@@ -9,7 +9,7 @@ toolchain go1.24.0
2
3 require (
4 git.sr.ht/~delthas/senpai v0.3.1-0.20250311003540-18f699aaf9b0
5- git.sr.ht/~rockorager/vaxis v0.12.1-0.20250309233058-d6d466f8f9b1
6+ git.sr.ht/~rockorager/vaxis v0.12.1-0.20250312161844-81636f76af83
7 github.com/alecthomas/chroma/v2 v2.14.0
8 github.com/antoniomika/syncmap v1.0.0
9 github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de
M
go.sum
+2,
-0
1@@ -22,6 +22,8 @@ git.sr.ht/~delthas/senpai v0.3.1-0.20250311003540-18f699aaf9b0 h1:Knm2mHQwLsh1sv
2 git.sr.ht/~delthas/senpai v0.3.1-0.20250311003540-18f699aaf9b0/go.mod h1:RzVz1R7QRHGcRDnJTcr7AN/cD3rj9scdgvupkXTJLYk=
3 git.sr.ht/~rockorager/vaxis v0.12.1-0.20250309233058-d6d466f8f9b1 h1:o8opVUAysn+cQAnSadL1BVMhr2YcdjynRzPBz4fa9q0=
4 git.sr.ht/~rockorager/vaxis v0.12.1-0.20250309233058-d6d466f8f9b1/go.mod h1:RSNtZnMeIwpyQzgIEYo9EHJb8Wcl/RhFSxypLpD/ajg=
5+git.sr.ht/~rockorager/vaxis v0.12.1-0.20250312161844-81636f76af83 h1:9eVqJxJzMdnpfqfKKjvEvNDpVg6sIBvbI4FdTjhHqx8=
6+git.sr.ht/~rockorager/vaxis v0.12.1-0.20250312161844-81636f76af83/go.mod h1:h94aKek3frIV1hJbdXjqnBqaLkbWXvV+UxAsQHg9bns=
7 github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96 h1:cTp8I5+VIoKjsnZuH8vjyaysT/ses3EvZeaV/1UkF2M=
8 github.com/AndreasBriese/bbloom v0.0.0-20190825152654-46b345b51c96/go.mod h1:bOvUY6CB00SOBii9/FifXqc0awNKxLFCL/+pkDPuyl8=
9 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+2,
-2
1@@ -17,14 +17,14 @@ func NewPager() *Pager {
2 func (m *Pager) HandleEvent(ev vaxis.Event, ph vxfw.EventPhase) (vxfw.Command, error) {
3 switch msg := ev.(type) {
4 case vaxis.Key:
5- if msg.Matches('j') {
6+ if msg.Matches('j') || msg.Matches(vaxis.KeyDown) {
7 if m.pos == -1*int(m.Surface.Size.Height) {
8 return nil, nil
9 }
10 m.pos -= 1
11 return vxfw.RedrawCmd{}, nil
12 }
13- if msg.Matches('k') {
14+ if msg.Matches('k') || msg.Matches(vaxis.KeyUp) {
15 if m.pos == 0 {
16 return nil, nil
17 }