From 900a842f50e9168624c91b3fe3630e1c1b5782aa Mon Sep 17 00:00:00 2001 From: Scott Leggett Date: Wed, 21 Sep 2022 14:34:02 +0800 Subject: [PATCH] fix: off-by-one error in spinner example --- examples/spinners/main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/spinners/main.go b/examples/spinners/main.go index d84e06b..53e5853 100644 --- a/examples/spinners/main.go +++ b/examples/spinners/main.go @@ -55,7 +55,7 @@ func (m model) Update(msg tea.Msg) (tea.Model, tea.Cmd) { return m, tea.Quit case "h", "left": m.index-- - if m.index <= 0 { + if m.index < 0 { m.index = len(spinners) - 1 } m.resetSpinner()