Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a setting to ignore dirty tabs in workbench.editor.limit.value #144309

Closed
buggymcbugfix opened this issue Mar 3, 2022 · 12 comments · Fixed by #144545
Closed

Add a setting to ignore dirty tabs in workbench.editor.limit.value #144309

buggymcbugfix opened this issue Mar 3, 2022 · 12 comments · Fixed by #144545
Assignees
Labels
author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes verification-needed Verification of issue is requested verified Verification succeeded workbench-editors Managing of editor widgets in workbench window
Milestone

Comments

@buggymcbugfix
Copy link

I have long been looking for a way to keep my tabs tidy and was extremely happy to find the workbench.editor.limit feature.
Per @bpasero #9872 (comment), dirty tabs count towards the editor tabs limit. This is unfortunate, because I often have several dirty tabs and once their number approaches the open tabs limit, I no longer get to open several clean tabs in parallel. I would like to have an option for workbench.editor.limit.value to ignore dirty tabs.

@bpasero
Copy link
Member

bpasero commented Mar 3, 2022

What happens when a dirty tab is getting closed due to the limit? You still need to get asked for saving or reverting no?

@bpasero bpasero added the info-needed Issue requires more information from poster label Mar 3, 2022
@buggymcbugfix
Copy link
Author

I would like dirty tabs to never get auto-closed (same behaviour as now). Dirty tabs should simply not count towards the limit. If my limit is 3 and I have 5 dirty tabs, then I still want to be able to open 3 clean tabs.

@bpasero
Copy link
Member

bpasero commented Mar 3, 2022

Oh I see.

@bpasero bpasero added feature-request Request for new features or functionality workbench-editors Managing of editor widgets in workbench window and removed info-needed Issue requires more information from poster labels Mar 3, 2022
@bpasero bpasero added this to the Backlog milestone Mar 3, 2022
@bpasero bpasero changed the title Feature request: ignore dirty tabs in workbench.editor.limit.value Add a setting to ignore dirty tabs in workbench.editor.limit.value Mar 3, 2022
@bpasero bpasero added good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities labels Mar 3, 2022
@bpasero
Copy link
Member

bpasero commented Mar 3, 2022

I think this can be done by a contribution via PR behind a new setting, relevant code piece is:

private async doEnsureOpenedEditorsLimit(limit: number, mostRecentEditors: IEditorIdentifier[], exclude?: IEditorIdentifier): Promise<void> {

@luoriyuhui21
Copy link
Contributor

hello,could I work on this issue as my first one ?

@bpasero
Copy link
Member

bpasero commented Mar 4, 2022

Yes, anyone can work on this 👍

@luoriyuhui21
Copy link
Contributor

this pr is as
#144545

@bpasero
Copy link
Member

bpasero commented Mar 7, 2022

Thanks, will take a look later this month.

@buggymcbugfix
Copy link
Author

thanks @bpasero @luoriyuhui21 ❤️

@bpasero bpasero added the author-verification-requested Issues potentially verifiable by issue author label Apr 8, 2022
@bpasero
Copy link
Member

bpasero commented Apr 19, 2022

Verification: play with the new workbench.editor.limit.excludeDirty setting and ensure it is working as advertised.

@bpasero bpasero added the on-release-notes Issue/pull request mentioned in release notes label Apr 19, 2022
@lramos15 lramos15 added the verified Verification succeeded label Apr 26, 2022
@lramos15
Copy link
Member

@bpasero This setting is sort of what I do with the tabs API sample. I wonder if we should just have an extension which implements all these caveats.

@github-actions github-actions bot locked and limited conversation to collaborators May 12, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
author-verification-requested Issues potentially verifiable by issue author feature-request Request for new features or functionality good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities insiders-released Patch has been released in VS Code Insiders on-release-notes Issue/pull request mentioned in release notes verification-needed Verification of issue is requested verified Verification succeeded workbench-editors Managing of editor widgets in workbench window
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants
@bpasero @lramos15 @buggymcbugfix @luoriyuhui21 and others