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

Add when context: isLastGroup / isFirstGroup / editorGroupIndex #22755

Closed
joshfrench opened this issue Mar 16, 2017 · 10 comments
Closed

Add when context: isLastGroup / isFirstGroup / editorGroupIndex #22755

joshfrench opened this issue Mar 16, 2017 · 10 comments
Assignees
Labels
feature-request Request for new features or functionality keybindings VS Code keybinding issues verification-needed Verification of issue is requested verified Verification succeeded workbench-editors Managing of editor widgets in workbench window
Milestone

Comments

@joshfrench
Copy link

  • VSCode Version: 1.10.2
  • OS Version: 10.11.6

I've remapped a shortcut to View: Focus Next Group. This command will open an additional group if I'm on the last group and have fewer than 3 groups currently open.

It would be great to have a when clause to prevent this. A clause like editor.isLastGroup (or perhaps a combination of editor.openGroupCount and editor.currentGroupIndex) would allow me to prevent extraneous group opening. A similar check for editor.isFirstGroup would let me re-use the same shortcut to jump back and forth between the first group and the sidebar.

Thanks for your consideration!

@bpasero bpasero added feature-request Request for new features or functionality workbench help wanted Issues identified as good community contribution opportunities labels Mar 17, 2017
@bpasero
Copy link
Member

bpasero commented Mar 17, 2017

PR welcome.

@bpasero bpasero removed their assignment Mar 17, 2017
@jaydenwindle
Copy link

+1 for this. Just switched from vim to vscode recently. Being able to jump back and forth between the sidebar and the first editor group in a similar manner to vim + NERDTree would be great.

I'd be happy to take a stab at a PR. @bpasero any advice for implementing this feature? Good places to start, people I should chat with about it, resources on how when clauses are implemented, etc. would all be helpful :)

@bpasero
Copy link
Member

bpasero commented Oct 13, 2017

@jaydenwindle maybe look how we update the context for diff editor being active or not: https://github.com/Microsoft/vscode/blob/master/src/vs/workbench/browser/parts/editor/editorPart.ts#L662

@bpasero bpasero added keybindings VS Code keybinding issues workbench-editors Managing of editor widgets in workbench window and removed help wanted Issues identified as good community contribution opportunities workbench labels Nov 16, 2017
@bpasero bpasero changed the title Feature request: when clauses for group metadata Add when context: isLastGroup / isFirstGroup Nov 17, 2017
@bpasero bpasero added help wanted Issues identified as good community contribution opportunities good first issue Issues identified as good for first-time contributors labels Nov 18, 2017
@bpasero bpasero changed the title Add when context: isLastGroup / isFirstGroup Add when context: isLastGroup / isFirstGroup / editorGroupIndex Nov 18, 2017
@Taguiar
Copy link

Taguiar commented Jan 22, 2018

@bpasero is this issue still open for the taking? If yes I would like to be assigned to it.

@bpasero
Copy link
Member

bpasero commented Jan 22, 2018

@Taguiar looks like it 👍

@bpasero bpasero removed help wanted Issues identified as good community contribution opportunities good first issue Issues identified as good for first-time contributors labels Apr 18, 2018
@bpasero bpasero self-assigned this Aug 9, 2019
@bpasero bpasero added this to the August 2019 milestone Aug 9, 2019
@bpasero
Copy link
Member

bpasero commented Aug 9, 2019

I added activeEditorGroupIndex and activeEditorGroupLast. The former one allows to find out if the first group is active by checking for activeEditorGroupIndex == 0

@bpasero bpasero closed this as completed Aug 9, 2019
@bpasero bpasero added the verification-needed Verification of issue is requested label Aug 24, 2019
@isidorn isidorn added the verified Verification succeeded label Aug 27, 2019
@isidorn
Copy link
Contributor

isidorn commented Aug 27, 2019

Just make sure to mention in the release notes that the index starts from 0 which can be confusing since in our UI we name groups GROUP 1, GROUP 2.

@bpasero
Copy link
Member

bpasero commented Aug 28, 2019

Hm good point, maybe I should change that.

@bpasero
Copy link
Member

bpasero commented Aug 28, 2019

I pushed a change to start activeEditorGroupIndex with 1.

@isidorn
Copy link
Contributor

isidorn commented Aug 28, 2019

Yeah makes sense. Change looks good, so I will not re-verify this.
Thanks

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality keybindings VS Code keybinding issues verification-needed Verification of issue is requested verified Verification succeeded workbench-editors Managing of editor widgets in workbench window
Projects
None yet
Development

No branches or pull requests

5 participants