-
Notifications
You must be signed in to change notification settings - Fork 27.9k
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
workbench: Adds actions for moveEditorToFirstGroup, moveEditorToSecondGroup, moveEditorToThirdGroup #40635
workbench: Adds actions for moveEditorToFirstGroup, moveEditorToSecondGroup, moveEditorToThirdGroup #40635
Conversation
@bpasero Are there any tests to extend upon? |
@@ -363,6 +363,9 @@ registry.registerWorkbenchAction(new SyncActionDescriptor(MoveGroupLeftAction, M | |||
registry.registerWorkbenchAction(new SyncActionDescriptor(MoveGroupRightAction, MoveGroupRightAction.ID, MoveGroupRightAction.LABEL, { primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyCode.RightArrow) }), 'View: Move Editor Group Right', category); | |||
registry.registerWorkbenchAction(new SyncActionDescriptor(MoveEditorToPreviousGroupAction, MoveEditorToPreviousGroupAction.ID, MoveEditorToPreviousGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.LeftArrow, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.LeftArrow } }), 'View: Move Editor into Previous Group', category); | |||
registry.registerWorkbenchAction(new SyncActionDescriptor(MoveEditorToNextGroupAction, MoveEditorToNextGroupAction.ID, MoveEditorToNextGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.RightArrow, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.RightArrow } }), 'View: Move Editor into Next Group', category); | |||
registry.registerWorkbenchAction(new SyncActionDescriptor(MoveEditorToFirstGroupAction, MoveEditorToFirstGroupAction.ID, MoveEditorToFirstGroupAction.LABEL, { primary: KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_1, mac: { primary: KeyMod.CtrlCmd | KeyMod.WinCtrl | KeyCode.KEY_1 } }), 'View: Move Editor into First Group', category); |
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.
@shobhitchittora keybinding KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_1
is already taken by "Toggle Editor Layout" and cannot be used again
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.
Correct me if I'm wrong -
- The primary key binding scheme is applied to Windows and Linux builds. Mac has it's own primary binding object specified.
KeyMod.CtrlCmd | KeyMod.Alt | KeyCode.KEY_1
is MAC-primary for "Toggle Editor Layout", while it's WIN/LINUX-primary for "MoveEditorToFirstGroupAction".- Any other suggestions?
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.
@shobhitchittora you are right, sorry I did not see the mac specific keybinding
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.
Thanks for looking into it 👍🏻.
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.
Done.
|
||
export class MoveEditorToFirstGroupAction extends Action { | ||
|
||
public static readonly ID = 'workbench.action.moveEditorToFirstGroupAction'; |
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.
@shobhitchittora remove the trailing Action
from the action ids (e.g. workbench.action.moveEditorToFirstGroup
)
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.
Done.
@@ -1553,3 +1553,75 @@ export class MoveEditorToNextGroupAction extends Action { | |||
return TPromise.as(true); | |||
} | |||
} | |||
|
|||
export class MoveEditorToFirstGroupAction extends Action { |
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.
@shobhitchittora all these actions are very similar in their implementation. Can we have a base class (abstract) that all classes extend from and in the base class we simply have a method to ask for the position?
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.
Yes on it.
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.
Done 💅🏻.
@bpasero Please review now.
2f6209a
to
bfabb2a
Compare
@bpasero Any idea why Travis is failing? |
LGTM thanks 👍 |
Hi, Why couldn't I find these shortcuts in my Thank you |
@hardianlawi they got removed. Read this and this. |
Adds the following actions for workbench tabs -
(For Mac Only - TODO: Need to confirm the same in Win & UNIX)
^ ⌘ 1
^ ⌘ 2
^ ⌘ 3
Fixes: #40525