MCPcopy
hub / github.com/anomalyco/opencode / restore

Function restore

packages/app/src/pages/session/file-tabs.tsx:115–133  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

113 }
114
115 const restore = () => {
116 const el = scroll
117 if (!el) return
118
119 const pos = input.view().scroll(input.tab())
120 if (!pos) return
121
122 sync()
123
124 if (code().length > 0) {
125 for (const item of code()) {
126 if (item.scrollLeft !== pos.x) item.scrollLeft = pos.x
127 }
128 }
129
130 if (el.scrollTop !== pos.y) el.scrollTop = pos.y
131 if (code().length > 0) return
132 if (el.scrollLeft !== pos.x) el.scrollLeft = pos.x
133 }
134
135 const queueRestore = () => {
136 if (restoreFrame !== undefined) return

Callers 2

queueRestoreFunction · 0.70
setViewportFunction · 0.70

Calls 2

syncFunction · 0.70
codeFunction · 0.50

Tested by

no test coverage detected