-
Notifications
You must be signed in to change notification settings - Fork 37.2k
Display Tab Indexes in VSCode #209196
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
Display Tab Indexes in VSCode #209196
Conversation
|
@microsoft-github-policy-service agree |
moataz2002
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice to be merged
|
Please create an issue for this feature and link this PR. Make sure to add a detailed description which describes the use case and the problem it solves. FYI we added custom editor labels in this months release. It allows you change the name of the open editors/tabs. The setting name is |
fixes #209533 |
I like the idea of having a new variable for the tab index for custom editor labels. Maybe one that is group-relative and one that is global? |
It would be great if we could add it to this setting |
|
I would disagree with making this part of the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a quick review. Haven't tested yet. Also there is a merge conflict. But we still need to finish discussing if and how this should exactly work.
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts
Outdated
Show resolved
Hide resolved
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts
Outdated
Show resolved
Hide resolved
I agree with your statement. I used to think that I was worried about adding too many settings and causing redundancy. In fact, what I am more concerned about is being able to correctly switch to the corresponding editor when using the vim plugin through the [tab index] gt command. I hope to use this feature in the next release so that I don't have to look for plugins every once in a while to see if they can be implemented :) |
84a50a5 to
a3e0c91
Compare
|
I have made the code modifications as required, specifically modifying the following: |
bpasero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am still not 100% sold that this cannot be configured through editor custom labels. We now limit this feature to how the index appears by hardcoding it (using just the number or number + dot) when people maybe want to configure this (see https://github.com/mkitt/tabline.vim where colon is used).
src/vs/workbench/browser/parts/editor/multiEditorTabsControl.ts
Outdated
Show resolved
Hide resolved
|
@bpasero Custom Labels work solely based on the file path. It's possible that a custom label is rendered for a file which is not opened. In that case no index could be resolved. Imagine the template Also, if custom labels would use editor group information, it would probably strongly impact performance. I wonder if we could still allow this to be customized without using custom labels. Any ideas? |
|
@swordjjjkkk Untitled editors are not getting the index prepended: |
|
Is this still relevant? |
We will add the tab index with a predefined format for the moment. If the index format needs to be configurable in the future we can consider that later.
bpasero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I will review later
bpasero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is not in a good state, esp. around the last commit that adds knowledge about how to render untitled into the tabs control.
I would expose a new option prefix on the label that is passed down based on this setting.
bpasero
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The display of tab index cannot be localised, which I think is fair considering we want to define how the experience is, but just wanted to note that maybe not in all languages {number}: {name} is natural.
|
Thanks a lot! |
|
I've already experienced this feature in the Code Insiders version, and I find it very useful. |

I'd like a setting to decide show tab index.
there are two reasons i need to open this pull request.
1.It's useful for vim extension use <leader>+num to switch tab pages , and this won't disturb regular users, as it is disabled by default.
2.I tried compile an oss version , but the remote-ssh Extension not support oss version.
I look forward to any feedback or suggestions for improvement. Thank you for considering.