Skip to content

Add [Exclude Pinned Tabs] checkbox #7

Description

@Cinabutts

Simple checkbox addition to exclude pinned tabs from auto removal

Image

package.json

+++ extensions\b9software.vsx-auto-close-tab-1.0.0\package.json
@@ -15,11 +15,11 @@
 	"contributes": {
 		"configuration": {
 			"properties": {
+				"B9AutoCloseTab.excludePinned": {
+					"default": false,
+					"description": "Exclude pinned tabs from the maximum tab limit count",
+					"type": "boolean"
+				},
 				"B9AutoCloseTab.maxTabs": {
 					"default": 7,
 					"description": "Maximum number of tabs to keep open in each editor group",

extension.json

Image
+ exc=O().get("excludePinned",false),

+ if(exc&&a.isPinned)continue;

Within context:

updateTabActivation(t,e){let i=this.r(t,e);i&&this.t.set(i,Date.now())}async s(){for(let t of s.all)await this.u(t);this.p()}async u(t){let e=$(),exc=O().get("excludePinned",false),i=[];for(let a of t.tabs){let p=this.r(t,a);if(!p)continue;if(exc&&a.isPinned)continue;let v=this.t.get(p);v||this.t.set(p,Date.now()),i.push({lastActiveTime:v??Date.now(),tab:a,tabKey:p})}if(i.length<=e)return;

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions