Add setting to show editor indexes in Open Editors view#313946
Open
duphyf wants to merge 1 commit intomicrosoft:mainfrom
Open
Add setting to show editor indexes in Open Editors view#313946duphyf wants to merge 1 commit intomicrosoft:mainfrom
duphyf wants to merge 1 commit intomicrosoft:mainfrom
Conversation
Author
@microsoft-github-policy-service agree |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds a new Explorer setting to show 1-based editor indexes in the Open Editors view, aligning that view more closely with the existing tab index behavior in the editor area.
Changes:
- Registers a new
explorer.openEditors.showTabIndexboolean setting under the Explorer configuration. - Updates
OpenEditorsViewto refresh when the new setting changes. - Prefixes Open Editors labels with each editor's 1-based index within its group when the setting is enabled.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/vs/workbench/contrib/files/browser/views/openEditorsView.ts |
Refreshes the Open Editors list on configuration changes and adds the optional index prefix to rendered editor labels. |
src/vs/workbench/contrib/files/browser/files.contribution.ts |
Declares the new explorer.openEditors.showTabIndex setting in the Explorer configuration schema. |
Comment on lines
+683
to
688
| const showTabIndex = this.configurationService.getValue<boolean>('explorer.openEditors.showTabIndex'); | ||
| const editorIndex = openedEditor.group.getIndexOfEditor(openedEditor.editor); | ||
| const namePrefix = showTabIndex | ||
| ? `${editorIndex + 1}: ` | ||
| : undefined; | ||
| templateData.root.setResource({ |
Comment on lines
+443
to
+446
| 'explorer.openEditors.showTabIndex': { | ||
| 'type': 'boolean', | ||
| 'description': nls.localize('openEditorsShowTabIndex', 'When enabled, will show the tab index.'), | ||
| 'default': false, |
Author
|
@microsoft-github-policy-service agree |
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 join this conversation on GitHub.
Already have an account?
Sign in to comment
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 #313945
Summary
This PR adds a new setting:
When enabled, the Open Editors view shows the 1-based index of each editor within its editor group.
This mirrors the existing editor tab index behavior by using the existing
namePrefix.Verification
Manually verified:
explorer.openEditors.showTabIndex"workbench.editor.showTabs": "none"explorer.openEditors.sortOrderImplementation notes
namePrefixsupportexplorer.openEditors.showTabIndexchangesexplorer.openEditors.sortOrderupdate logic separate from repaint-only configuration changes