Skip to content

Commit

Permalink
editors - keybinding for split/join editor and dedicated color (micro…
Browse files Browse the repository at this point in the history
  • Loading branch information
bpasero authored and Suven-p committed Sep 7, 2021
1 parent b4cf253 commit fb93809
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 11 deletions.
14 changes: 12 additions & 2 deletions src/vs/workbench/browser/parts/editor/editorCommands.ts
Expand Up @@ -955,7 +955,12 @@ function registerSplitEditorInGroupCommands(): void {
title: localize('splitEditorInGroup', "Split Active Editor in Group"),
category: CATEGORIES.View,
precondition: ActiveEditorCanSplitInGroupContext,
f1: true
f1: true,
keybinding: {
weight: KeybindingWeight.WorkbenchContrib,
when: ActiveEditorCanSplitInGroupContext,
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKSLASH)
}
});
}
async run(accessor: ServicesAccessor): Promise<void> {
Expand All @@ -981,7 +986,12 @@ function registerSplitEditorInGroupCommands(): void {
title: localize('joinEditorInGroup', "Join Active Editor in Group"),
category: CATEGORIES.View,
precondition: ActiveEditorContext.isEqualTo(SideBySideEditor.ID),
f1: true
f1: true,
keybinding: {
weight: KeybindingWeight.WorkbenchContrib,
when: ActiveEditorContext.isEqualTo(SideBySideEditor.ID),
primary: KeyChord(KeyMod.CtrlCmd | KeyCode.KEY_K, KeyMod.CtrlCmd | KeyMod.Shift | KeyCode.US_BACKSLASH)
}
});
}
async run(accessor: ServicesAccessor): Promise<void> {
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/browser/parts/editor/sideBySideEditor.ts
Expand Up @@ -24,7 +24,7 @@ import { IEditorOptions } from 'vs/platform/editor/common/editor';
import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { DEFAULT_EDITOR_MIN_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { EDITOR_GROUP_BORDER } from 'vs/workbench/common/theme';
import { EDITOR_PANE_BORDER } from 'vs/workbench/common/theme';

export class SideBySideEditor extends EditorPane {

Expand Down Expand Up @@ -278,13 +278,13 @@ export class SideBySideEditor extends EditorPane {
if (this.orientation === Orientation.HORIZONTAL) {
this.primaryEditorContainer.style.borderLeftWidth = '1px';
this.primaryEditorContainer.style.borderLeftStyle = 'solid';
this.primaryEditorContainer.style.borderLeftColor = this.getColor(EDITOR_GROUP_BORDER)?.toString() ?? '';
this.primaryEditorContainer.style.borderLeftColor = this.getColor(EDITOR_PANE_BORDER)?.toString() ?? '';

this.primaryEditorContainer.style.borderTopWidth = '0';
} else {
this.primaryEditorContainer.style.borderTopWidth = '1px';
this.primaryEditorContainer.style.borderTopStyle = 'solid';
this.primaryEditorContainer.style.borderTopColor = this.getColor(EDITOR_GROUP_BORDER)?.toString() ?? '';
this.primaryEditorContainer.style.borderTopColor = this.getColor(EDITOR_PANE_BORDER)?.toString() ?? '';

this.primaryEditorContainer.style.borderLeftWidth = '0';
}
Expand Down
12 changes: 6 additions & 6 deletions src/vs/workbench/common/theme.ts
Expand Up @@ -195,12 +195,6 @@ export const EDITOR_PANE_BACKGROUND = registerColor('editorPane.background', {
hc: editorBackground
}, localize('editorPaneBackground', "Background color of the editor pane visible on the left and right side of the centered editor layout."));

registerColor('editorGroup.background', {
dark: null,
light: null,
hc: null
}, localize('editorGroupBackground', "Deprecated background color of an editor group."), false, localize('deprecatedEditorGroupBackground', "Deprecated: Background color of an editor group is no longer being supported with the introduction of the grid editor layout. You can use editorGroup.emptyBackground to set the background color of empty editor groups."));

export const EDITOR_GROUP_EMPTY_BACKGROUND = registerColor('editorGroup.emptyBackground', {
dark: null,
light: null,
Expand Down Expand Up @@ -243,6 +237,12 @@ export const EDITOR_GROUP_BORDER = registerColor('editorGroup.border', {
hc: contrastBorder
}, localize('editorGroupBorder', "Color to separate multiple editor groups from each other. Editor groups are the containers of editors."));

export const EDITOR_PANE_BORDER = registerColor('editorPane.border', {
dark: EDITOR_GROUP_BORDER,
light: EDITOR_GROUP_BORDER,
hc: EDITOR_GROUP_BORDER
}, localize('editorPane.border', "Color to separate multiple editors from each other in an editor group."));

export const EDITOR_DRAG_AND_DROP_BACKGROUND = registerColor('editorGroup.dropBackground', {
dark: Color.fromHex('#53595D').transparent(0.5),
light: Color.fromHex('#2677CB').transparent(0.18),
Expand Down

0 comments on commit fb93809

Please sign in to comment.