Merge pull request #1226 from dbgate/feature/close-tabs

message: close right side tabs #1219
This commit is contained in:
Jan Prochazka
2025-10-21 14:15:25 +02:00
committed by GitHub

View File

@@ -171,6 +171,10 @@
(x, active) => x.tabid != active.tabid && (x.multiTabIndex || 0) == multiTabIndex, (x, active) => x.tabid != active.tabid && (x.multiTabIndex || 0) == multiTabIndex,
tabs => tabs.map(x => (x.selected ? { ...x, tabPreviewMode: false } : x)) tabs => tabs.map(x => (x.selected ? { ...x, tabPreviewMode: false } : x))
); );
const closeRightTabs = multiTabIndex =>
closeTabFunc(
(x, active) => x.tabid != active.tabid && (x.multiTabIndex || 0) == multiTabIndex && x.tabOrder > active.tabOrder
);
const reopenClosedTab = () => { const reopenClosedTab = () => {
const lastClosedTabId = getOpenedTabs() const lastClosedTabId = getOpenedTabs()
.filter(x => x.closedTime) .filter(x => x.closedTime)
@@ -445,6 +449,10 @@
text: 'Close others', text: 'Close others',
onClick: () => closeOthersInMultiTab(multiTabIndex)(tabid), onClick: () => closeOthersInMultiTab(multiTabIndex)(tabid),
}, },
{
text: 'Close to the right',
onClick: () => closeRightTabs(multiTabIndex)(tabid),
},
{ {
text: 'Duplicate', text: 'Duplicate',
onClick: () => duplicateTab(tab), onClick: () => duplicateTab(tab),