Allow "Move Editor into Previous Group" to create new group#275968
Merged
bpasero merged 3 commits intomicrosoft:mainfrom Nov 11, 2025
Merged
Allow "Move Editor into Previous Group" to create new group#275968bpasero merged 3 commits intomicrosoft:mainfrom
bpasero merged 3 commits intomicrosoft:mainfrom
Conversation
Fixes microsoft#262817 When the active editor is in the leftmost group and there is no previous group, "Move Editor into Previous Group" now creates a new group in the opposite direction of the user's preferred side-by-side setting and moves the editor there. This mirrors the existing behavior of "Move Editor into Next Group". The new group is only created if the source group contains 2+ editors, preventing the source group from being left empty. The direction respects the `workbench.editor.openSideBySideDirection` setting - if the preference is RIGHT (horizontal), the new group is created to the LEFT; if DOWN (vertical), the new group is created UP.
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @bpaseroMatched files:
|
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR enhances the behavior of the moveActiveEditor command for the 'previous' case. When moving an editor to a previous group and no previous group exists, the code now creates a new group in the opposite direction of the user's preferred side-by-side direction, but only when the source group has 2 or more editors.
Key changes:
- Added logic to create a new group when moving to 'previous' and no previous group exists
- The new group is created in the opposite direction (LEFT if preferred is RIGHT, UP if preferred is DOWN)
- This behavior only activates when the source group has at least 2 editors
Member
|
I commented about this feature in #262817 (comment) |
bpasero
approved these changes
Nov 11, 2025
rebornix
approved these changes
Nov 11, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #262817
When the active editor is in the first group and there is no previous group, "Move Editor into Previous Group" now creates a new group before the current group, and moves the editor there. This mirrors the existing behavior of "Move Editor into Next Group".
The new group is only created if the source group contains 2+ editors, preventing the source group from being left empty. The direction respects the
workbench.editor.openSideBySideDirectionsetting - if the preference is RIGHT (horizontal), the new group is created to the LEFT; if DOWN (vertical), the new group is created UP.Suggestions on where to add tests for this would be appreciated.