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

Closing a tab via API changes focus #145111

Closed
jrieken opened this issue Mar 15, 2022 · 4 comments
Closed

Closing a tab via API changes focus #145111

jrieken opened this issue Mar 15, 2022 · 4 comments
Assignees
Labels
api feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded workbench-tabs VS Code editor tab issues
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Mar 15, 2022

There is currently no way to specific the focus behaviour when closing tabs. The API usually does that via the preserveFocus boolean

@lramos15 lramos15 added feature-request Request for new features or functionality api workbench-tabs VS Code editor tab issues labels Mar 15, 2022
@lramos15 lramos15 added this to the March 2022 milestone Mar 15, 2022
@jrieken
Copy link
Member Author

jrieken commented Mar 15, 2022

fyi @lszomoru this can help to keep focus inside the SCM box when making a commit. Today this happens

  • many diff editor
  • make a commit
  • focus moves to editor pane :sad:
  • I would rather keep focus in the commit box and press tab for the "big button"

@lszomoru
Copy link
Member

@jrieken, I believe this has been addressed already by @lramos15 as he has refactored the code.

window.tabGroups.close(diffEditorTabsToClose, true);

@jrieken
Copy link
Member Author

jrieken commented Mar 21, 2022

Yeah, we decided to simply push that 🤓

@lramos15 lramos15 added the verification-needed Verification of issue is requested label Mar 21, 2022
@lramos15
Copy link
Member

To verify:

  1. Ensure "git.closeDiffOnOperation": true is in your settings
  2. Open a change in the changes view
  3. Stage the file
  4. 🎉 It should close the diff while preserving focus

@jrieken jrieken added the verified Verification succeeded label Mar 22, 2022
@github-actions github-actions bot locked and limited conversation to collaborators Apr 29, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
api feature-request Request for new features or functionality insiders-released Patch has been released in VS Code Insiders verification-needed Verification of issue is requested verified Verification succeeded workbench-tabs VS Code editor tab issues
Projects
None yet
Development

No branches or pull requests

4 participants
@jrieken @lszomoru @lramos15 and others