Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ This extension contributes the following settings:

- `auto-arrange-tabs.millis`: The number of milliseconds to move the tab from activation.
- `auto-arrange-tabs.fixTabs`: The number of fixed tabs from left side. They don't move when time is reached.
- `auto-arrange-tabs.countPinnedInFixTabs`: Whether pinned tabs are counted as part of the fixed tabs. If false, fixed tabs = pinned tabs + fixTabs.

## Release Notes

Expand Down
10 changes: 8 additions & 2 deletions extension.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,15 @@ const activate = () => {
// Find tab numbers with matching labels.
const tabNum = getActiveTabNum(activeGroup);
console.log("tn", tabNum);
if (tabNum < config.get("fixTabs")) return;
const pinnedCount = getNotPinnedNum(activeGroup) ?? activeGroup.tabs.length;
const fixedTabs = config.get("fixTabs");
const countPinnedInFixTabs = config.get("countPinnedInFixTabs");
const fixedThreshold = countPinnedInFixTabs
? fixedTabs
: pinnedCount + fixedTabs;
if (tabNum < fixedThreshold) return;

const notPinnedNum = getNotPinnedNum(activeGroup);
const notPinnedNum = pinnedCount;
vscode.commands.executeCommand("moveActiveEditor", {
by: "tab",
to: "left",
Expand Down
6 changes: 6 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@
"scope": "resource",
"type": "number"
},
"auto-arrange-tabs.countPinnedInFixTabs": {
"default": true,
"markdownDescription": "Whether pinned tabs are counted as part of the fixed tabs. If false, fixed tabs = pinned tabs + fixTabs.",
"scope": "resource",
"type": "boolean"
},
"auto-arrange-tabs.millis": {
"default": 3000,
"markdowDescription": "Specifies the number of milliseconds to move the tab from activation.",
Expand Down