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

added split pane options to settings #82888

Merged

Conversation

dhairyanadapara
Copy link
Contributor

This PR fixes #79665

  • Added the setting for splitting the pane into multiple parts
  • User has 2 options:
    • Split: Selected editor splits into equal parts
    • Distribute: All editors splits into equal parts
  • Same while closing editors

@msftclas
Copy link

msftclas commented Oct 19, 2019

CLA assistant check
All CLA requirements met.

@bpasero
Copy link
Member

bpasero commented Oct 20, 2019

@dhairyanadapara I think you are adding the option on the wrong layer (monaco editor), shouldn't the setting appear very similar to other existing editor settings, such as workbench.editor.closeEmptyGroups?

@bpasero bpasero self-assigned this Oct 20, 2019
@bpasero bpasero added the info-needed Issue requires more information from poster label Oct 20, 2019
@dhairyanadapara dhairyanadapara force-pushed the splitting-pane-options-to-settings branch from bace6a2 to 3fe5f8b Compare October 20, 2019 08:31
@dhairyanadapara
Copy link
Contributor Author

Thanks, @bpasero. Found out the same. I have moved options to workbench.editor

@@ -37,7 +37,8 @@ export const DEFAULT_EDITOR_PART_OPTIONS: IEditorPartOptions = {
openSideBySideDirection: 'right',
closeEmptyGroups: true,
labelFormat: 'default',
iconTheme: 'vs-seti'
iconTheme: 'vs-seti',
splitSizing: 'Distribute'
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer lowercase distribute and split

nls.localize('workbench.editor.splitSizing.Distribute', "Splits all the editors to equal parts."),
nls.localize('workbench.editor.splitSizing.Split', "Splits the active editor to equal parts.")
],
'description': nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'splitSizing' }, "Controls the sizing of editor tabs.")
Copy link
Member

Choose a reason for hiding this comment

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

Controls the sizing of editor tabs. => Controls the sizing of editors when splitting them.

@@ -60,6 +60,16 @@ import { isMacintosh, isWindows, isLinux, isWeb, isNative } from 'vs/base/common
],
'description': nls.localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'tabSizing' }, "Controls the sizing of editor tabs.")
},
'workbench.editor.splitSizing': {
'type': 'string',
'enum': ['Distribute', 'Split'],
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer lowercase distribute and split

'enum': ['Distribute', 'Split'],
'default': 'Distribute',
'enumDescriptions': [
nls.localize('workbench.editor.splitSizing.Distribute', "Splits all the editors to equal parts."),
Copy link
Member

Choose a reason for hiding this comment

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

workbench.editor.splitSizing.Distribute => workbench.editor.splitSizingDistribute

workbench.editor.splitSizing.Split => workbench.editor.splitSizingSplit

@@ -1025,6 +1025,7 @@ interface IEditorPartConfiguration {
mouseBackForwardToNavigate?: boolean;
labelFormat?: 'default' | 'short' | 'medium' | 'long';
restoreViewState?: boolean;
splitSizing?: 'Split' | 'Distribute';
Copy link
Member

Choose a reason for hiding this comment

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

I would prefer lowercase distribute and split

@@ -497,13 +497,18 @@ export class EditorPart extends Part implements IEditorGroupsService, IEditorGro
return group;
}

private _getSizingStyle(): Sizing {
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
private _getSizingStyle(): Sizing {
private getSplitSizingStyle(): Sizing {
const splitStyle = this._partOptions.splitSizing;
if (splitStyle === 'Split') {
return Sizing.Split;
}
return Sizing.Distribute;
}

@bpasero bpasero added this to the October 2019 milestone Oct 21, 2019
@bpasero bpasero removed the info-needed Issue requires more information from poster label Oct 21, 2019
Dhaiyra and others added 2 commits October 21, 2019 21:09
@bpasero bpasero merged commit 0abf6cf into microsoft:master Oct 21, 2019
@bpasero
Copy link
Member

bpasero commented Oct 21, 2019

Thanks 👍

@dhairyanadapara
Copy link
Contributor Author

Thanks, @bpasero. This was my first contribution to open source and I enjoyed it. If you found any other issue in which I can help, please assign it. Thanks again for helping. :)

@github-actions github-actions bot locked and limited conversation to collaborators Mar 28, 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.

Option to not automatically resize all panes when splitting a pane
3 participants