about summary refs log tree commit diff
diff options
context:
space:
mode:
authorProfpatsch <mail@profpatsch.de>2021-04-05T21·35+0200
committerProfpatsch <mail@profpatsch.de>2021-04-23T18·30+0000
commit77840fba2c1e4e900e27df0163f39ccc7a0c48a6 (patch)
tree08d6e58e2ae806c6b39feb4f11602eca2890cffd
parentf57f1e4489a0a98d57e2a696ac54d8cd0eeec34a (diff)
fix(users/Profpatsch/struct-edit): change arrow keys r/2540
Since items are aligned per-line, it makes more intuitive sense to use
up/down for previous/next item, and left to go up and right to go
down.

Change-Id: I6bc33bd4e6e8f9fb245d252ca063dfabf972147d
Reviewed-on: https://cl.tvl.fyi/c/depot/+/2864
Tested-by: BuildkiteCI
Reviewed-by: Profpatsch <mail@profpatsch.de>
-rw-r--r--users/Profpatsch/struct-edit/main.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/users/Profpatsch/struct-edit/main.go b/users/Profpatsch/struct-edit/main.go
index 06d05a695d08..f40c6df66db8 100644
--- a/users/Profpatsch/struct-edit/main.go
+++ b/users/Profpatsch/struct-edit/main.go
@@ -333,16 +333,16 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) {
 			return m, tea.Quit
 
 		case "up":
-			m, err = m.ascend()
+			m, err = m.prev()
 
 		case "down":
-			m, err = m.descend()
+			m, err = m.next()
 
 		case "right":
-			m, err = m.next()
+			m, err = m.descend()
 
 		case "left":
-			m, err = m.prev()
+			m, err = m.ascend()
 
 			// 	case "enter":
 			// 		_, ok := m.selected[m.cursor]