(tab: IEditorTab, groupId: UniqueId)
| 499 | } |
| 500 | |
| 501 | public closeToRight(tab: IEditorTab, groupId: UniqueId) { |
| 502 | const groupIndex = this.getGroupIndexById(groupId); |
| 503 | if (groupIndex <= -1) return; |
| 504 | |
| 505 | const { groups = [] } = this.state; |
| 506 | const nextGroups = [...groups]; |
| 507 | const tabId = tab.id; |
| 508 | const nextGroup = nextGroups[groupIndex]; |
| 509 | const nextTabData = nextGroup.data; |
| 510 | |
| 511 | const tabIndex = nextTabData!.findIndex(searchById(tabId)); |
| 512 | if (tabIndex <= -1) return; |
| 513 | |
| 514 | const updateTabs = nextTabData?.slice(0, tabIndex + 1); |
| 515 | const removedTabs = cloneDeep( |
| 516 | nextTabData?.slice(tabIndex + 1).filter( |
| 517 | (item) => |
| 518 | !this.isOpened( |
| 519 | item.id!, |
| 520 | nextGroups.filter((g) => g.id !== groupId) |
| 521 | ) |
| 522 | ) |
| 523 | ); |
| 524 | |
| 525 | this.updateGroup(groupId, { |
| 526 | data: updateTabs, |
| 527 | }); |
| 528 | this.setActive(groupId, tabId!); |
| 529 | this.disposeModel(removedTabs || []); |
| 530 | this.explorerService.forceUpdate(); |
| 531 | } |
| 532 | |
| 533 | public closeToLeft(tab: IEditorTab, groupId: UniqueId) { |
| 534 | const groupIndex = this.getGroupIndexById(groupId); |
nothing calls this directly
no test coverage detected