Skip to content

Add Non-Wrapping EditorGroup-focus actions#108071

Merged
bpasero merged 7 commits intomicrosoft:masterfrom
Agreon:add-non-wrapping-editor-group-focus-actions
Oct 8, 2020
Merged

Add Non-Wrapping EditorGroup-focus actions#108071
bpasero merged 7 commits intomicrosoft:masterfrom
Agreon:add-non-wrapping-editor-group-focus-actions

Conversation

@Agreon
Copy link
Contributor

@Agreon Agreon commented Oct 4, 2020

This PR fixes #107873

The desired behaviour mentioned in the issue can be achieved by adding the new actions as key-bindings.

@ghost
Copy link

ghost commented Oct 4, 2020

CLA assistant check
All CLA requirements met.

@bpasero bpasero self-assigned this Oct 5, 2020
@bpasero bpasero added this to the October 2020 milestone Oct 5, 2020
registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusPreviousGroup), 'View: Focus Previous Editor Group', CATEGORIES.View.value);
registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusNextGroup), 'View: Focus Next Editor Group', CATEGORIES.View.value);
registry.registerWorkbenchAction(SyncActionDescriptor.from(FocusLeftGroup, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyCode.LeftArrow) }), 'View: Focus Left Editor Group', CATEGORIES.View.value);
registry.registerWorkbenchAction(SyncActionDescriptor.create(FocusLeftGroupWithoutWrap, FocusLeftGroupWithoutWrap.ID, undefined), 'View: Focus Left Editor Group Without Wrap', CATEGORIES.View.value);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As I mentioned before, I do not feel like these commands should appear in the command palette but only be available as commands for someone to assign. I feel this is making the list of commands otherwise a lot more complex without much value.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

By not supplying a label, they do not appear in the command palette, don't they? How would i register the action otherwise?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Agreon you can use CommandRegistry:

e.g.

CommandsRegistry.registerCommand(CLOSE_PINNED_EDITOR_COMMAND_ID, (accessor, resourceOrContext?: URI | IEditorCommandsContext, context?: IEditorCommandsContext) => {
return closeEditorHandler(accessor, true /* force close pinned editors */, resourceOrContext, context);
});

@bpasero bpasero marked this pull request as draft October 5, 2020 10:35
@bpasero bpasero modified the milestones: October 2020, On Deck Oct 5, 2020
@Agreon Agreon marked this pull request as ready for review October 7, 2020 17:51
@bpasero bpasero modified the milestones: On Deck, October 2020 Oct 8, 2020
@bpasero bpasero merged commit e039f7a into microsoft:master Oct 8, 2020
@bpasero
Copy link
Member

bpasero commented Oct 8, 2020

Thanks 👍

@github-actions github-actions bot locked and limited conversation to collaborators Dec 4, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add commands "workbench.action.focus(.*)Group" that do not wrap

2 participants