(t tab)
| 245 | } |
| 246 | |
| 247 | func prevTab(t tab) tab { |
| 248 | for i, x := range tabOrder { |
| 249 | if x == t { |
| 250 | return tabOrder[(i-1+len(tabOrder))%len(tabOrder)] |
| 251 | } |
| 252 | } |
| 253 | return tabHome |
| 254 | } |
| 255 | |
| 256 | // shutdown kills the engine subprocess if one is running, then quits the |
| 257 | // Bubble Tea program. Idempotent — safe to call when no engine is running. |