MCPcopy Index your code
hub / github.com/anomalyco/opencode / cycleTab

Function cycleTab

packages/opencode/src/cli/cmd/run/footer.view.tsx:341–356  ·  view source on GitHub ↗
(dir: -1 | 1)

Source from the content-addressed store, hash-verified

339 }
340
341 const cycleTab = (dir: -1 | 1) => {
342 if (tabs().length === 0) {
343 return
344 }
345
346 const routeState = route()
347 const current =
348 routeState.type === "subagent" ? tabs().findIndex((item) => item.sessionID === routeState.sessionID) : -1
349 const index = current === -1 ? 0 : (current + dir + tabs().length) % tabs().length
350 const next = tabs()[index]
351 if (!next) {
352 return
353 }
354
355 openTab(next.sessionID)
356 }
357 const composer = createPromptState({
358 directory: props.directory,
359 findFiles: props.findFiles,

Callers

nothing calls this directly

Calls 3

openTabFunction · 0.85
tabsFunction · 0.50
routeFunction · 0.50

Tested by

no test coverage detected