(offset: number)
| 293 | } |
| 294 | |
| 295 | function switchTab(offset: number) { |
| 296 | console.log("switchTab", offset); |
| 297 | const ws = globalStore.get(atoms.workspace); |
| 298 | const curTabId = globalStore.get(atoms.staticTabId); |
| 299 | let tabIdx = -1; |
| 300 | const tabids = getAllTabs(ws); |
| 301 | for (let i = 0; i < tabids.length; i++) { |
| 302 | if (tabids[i] == curTabId) { |
| 303 | tabIdx = i; |
| 304 | break; |
| 305 | } |
| 306 | } |
| 307 | if (tabIdx == -1) { |
| 308 | return; |
| 309 | } |
| 310 | const newTabIdx = (tabIdx + offset + tabids.length) % tabids.length; |
| 311 | const newActiveTabId = tabids[newTabIdx]; |
| 312 | getApi().setActiveTab(newActiveTabId); |
| 313 | } |
| 314 | |
| 315 | function handleCmdI() { |
| 316 | globalRefocus(); |
no test coverage detected