Rebind char cycling to ,/. instead of [/]
All checks were successful
Docker / build-and-push (push) Successful in 50s

[ and ] needed a reach/shift on most layouts and felt awkward next to
the otherwise all-unshifted control scheme (hjkl, space, digits). ,
and . are adjacent, unshifted, easy to hit without looking away from
the canvas -- a natural prev/next pair. Old bindings kept as a fallback
rather than removed.

Verified both in isolation (Update() with a KeyMsg) and live over a
real SSH session -- the status-line ink swatch visibly cycles from █
to ▓ on a fresh connection. An initial live test after the rebind
appeared to fail, but that traced to a stale session left over from
the server restart, not an actual bug -- confirmed working correctly
on a fresh connection.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Fredrik Johansson
2026-07-15 19:55:59 +02:00
parent 2b8c3ae6ee
commit 039e131304
4 changed files with 29 additions and 5 deletions

View File

@@ -80,9 +80,9 @@ func (m Model) handleKey(msg tea.KeyMsg) (tea.Model, tea.Cmd) {
m.canvas.Paint(cur.X, cur.Y, ' ', "")
}
case "[":
case ",", "[":
m.charIdx = (m.charIdx - 1 + len(charPalette)) % len(charPalette)
case "]":
case ".", "]":
m.charIdx = (m.charIdx + 1) % len(charPalette)
case "1", "2", "3", "4", "5", "6", "7", "8":