-
Notifications
You must be signed in to change notification settings - Fork 30k
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
API Request: Move Tab #8234
Comments
I'd like to leverage |
👍 |
@egamma @sandy081 I could look into this, since VIM is on the plan for July, do you think we should have it? @jrieken any objections adding more API commands like that to our API? This command imho does not make much sense as a global command (e.g. in F1) so I would only add it as parameterized API command. @rebornix to clarify, this is not about moving a tab to another editor group, only move it within a group right? |
@bpasero yes you are right! It's all about moving tabs within a group. I would be really happy to see this feature go with July 👍 |
Yeah, make sense to have that as a command tho I am not sure how you want to parameterise them. Do you have the Like Problem I see is that we don't expose in what tab an editor is, only in what view column |
I was about to ask the same question. @rebornix would the use case be to move the active tab that has keyboard focus or any tab (active and inactive) opened anywhere? |
@bpasero , moving current (active) tab is enough. Besides, Editor Group is a VS Code concept so moving active to other groups is not a Vim thing. All Vim users care about is just re-ordering tabs IMHO. |
Ok since this is very specific I also suggest an explicit command like:
Where the to @rebornix would you need a command to move 2 indexes to the left or right or is this enum enough? |
What would this command do when tabs aren't enabled? Should we strive for a command that handles both cases? |
Why not using string constants for arguments instead of enums. We cannot know what a number means while consuming in
The cursor commands which I am writing are string based. I think we should be consistent here either string or enums. |
@sandy081 @rebornix I suggest you guys add this command based on the pattern you find best suitable for VIM. It is very easy to move a tab to another index: You can get hold of the Use As for the arguments:
You can use The place where we add and document API commands is: https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/api/node/extHostApiCommands.ts#L212 |
If tabs are disabled, maybe you should actually move the editor between the groups? The API allows this easily and in order to find out that tabs are enabled or disabled, you could just go to the configuration service:
|
@bpasero didn't notice you asked me a quesiton about this feature. Moving tabs by specifying the index instead of
It's also easy to implement this command as we just need to pass the index to When the Tab feature is disabled, we can use Sounds good to you all? |
@rebornix Implemented Usage:
Position
By
Default: If tabs are enabled In Tabs mode:
In Groups mode:
1: Left, 2:Center, 3:Right Vim Usage for moving current active editor to:
If you track the # of tabs, then you can just use |
@rebornix Please note following changes to the API to make it neat and consistent with existing
Please adopt to these changes |
@sandy081 thanks, I've updated with the new signature. They worked. |
Per #6605 , we already exposed APIs to move active editors across groups. And we do support drag and drop tabs so I'm thinking can we expose tabs moving functionalities as API, then people can move tabs by commands.
This will benefit Vim extensions as moving tabs is a useful often-used command. For now only the last four commands can be implemented with existing APIs.
@bpasero @kieferrm
The text was updated successfully, but these errors were encountered: