Skip to content

Commit

Permalink
on/active/off -> all/active/none
Browse files Browse the repository at this point in the history
  • Loading branch information
hediet committed Oct 12, 2021
1 parent 1f070ea commit 2364b8d
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
8 changes: 4 additions & 4 deletions src/vs/editor/browser/viewParts/indentGuides/indentGuides.ts
Original file line number Diff line number Diff line change
Expand Up @@ -155,19 +155,19 @@ export class IndentGuidesOverlay extends DynamicViewOverlay {
visibleEndLineNumber: number,
activeCursorPosition: Position | null
): IndentGuide[][] {
const bracketGuides = this._bracketPairGuideOptions.bracketPairs !== 'off'
const bracketGuides = this._bracketPairGuideOptions.bracketPairs !== 'none'
? this._context.model.getBracketGuidesInRangeByLine(
visibleStartLineNumber,
visibleEndLineNumber,
activeCursorPosition,
{
highlightActive: this._bracketPairGuideOptions.highlightActiveBracketPair,
horizontalGuides: this._bracketPairGuideOptions.bracketPairsVertical === 'on'
horizontalGuides: this._bracketPairGuideOptions.bracketPairsHorizontal === 'all'
? HorizontalGuidesState.Enabled
: this._bracketPairGuideOptions.bracketPairsVertical === 'active'
: this._bracketPairGuideOptions.bracketPairsHorizontal === 'active'
? HorizontalGuidesState.EnabledForActive
: HorizontalGuidesState.Disabled,
includeInactive: this._bracketPairGuideOptions.bracketPairs === 'on',
includeInactive: this._bracketPairGuideOptions.bracketPairs === 'all',
}
)
: null;
Expand Down
24 changes: 12 additions & 12 deletions src/vs/editor/common/config/editorOptions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3347,15 +3347,15 @@ class BracketPairColorization extends BaseEditorOption<EditorOption.bracketPairC
export interface IGuidesOptions {
/**
* Enable rendering of bracket pair guides.
* Defaults to false.
* Defaults to 'none'.
*/
bracketPairs?: 'on' | 'off' | 'active';
bracketPairs?: 'all' | 'active' | 'none';

/**
* Enable rendering of vertical bracket pair guides.
* Defaults to 'active'.
*/
bracketPairsVertical?: 'on' | 'off' | 'active';
bracketPairsHorizontal?: 'all' | 'active' | 'none';

/**
* Enable highlighting of the active bracket pair.
Expand Down Expand Up @@ -3387,8 +3387,8 @@ export type InternalGuidesOptions = Readonly<Required<IGuidesOptions>>;
class GuideOptions extends BaseEditorOption<EditorOption.guides, InternalGuidesOptions> {
constructor() {
const defaults: InternalGuidesOptions = {
bracketPairs: 'off',
bracketPairsVertical: 'active',
bracketPairs: 'none',
bracketPairsHorizontal: 'active',
highlightActiveBracketPair: true,

indentation: true,
Expand All @@ -3400,15 +3400,15 @@ class GuideOptions extends BaseEditorOption<EditorOption.guides, InternalGuidesO
{
'editor.guides.bracketPairs': {
type: 'string',
enum: ['on', 'off', 'active'],
enum: ['all', 'active', 'none'],
default: defaults.bracketPairs,
description: nls.localize('editor.guides.bracketPairs', "Controls whether bracket pair guides are enabled or not.")
},
'editor.guides.bracketPairsVertical': {
'editor.guides.bracketPairsHorizontal': {
type: 'string',
enum: ['on', 'off', 'active'],
default: defaults.bracketPairsVertical,
description: nls.localize('editor.guides.bracketPairsVertical', "Controls whether vertical bracket pair guides are enabled or not.")
enum: ['all', 'active', 'none'],
default: defaults.bracketPairsHorizontal,
description: nls.localize('editor.guides.bracketPairsHorizontal', "Controls whether horizontal bracket pair guides are enabled or not.")
},
'editor.guides.highlightActiveBracketPair': {
type: 'boolean',
Expand All @@ -3435,8 +3435,8 @@ class GuideOptions extends BaseEditorOption<EditorOption.guides, InternalGuidesO
}
const input = _input as IGuidesOptions;
return {
bracketPairs: stringSet(input.bracketPairs, this.defaultValue.bracketPairs, ['on', 'off', 'active']),
bracketPairsVertical: stringSet(input.bracketPairsVertical, this.defaultValue.bracketPairsVertical, ['on', 'off', 'active']),
bracketPairs: stringSet(input.bracketPairs, this.defaultValue.bracketPairs, ['all', 'active', 'none']),
bracketPairsHorizontal: stringSet(input.bracketPairsHorizontal, this.defaultValue.bracketPairsHorizontal, ['all', 'active', 'none']),
highlightActiveBracketPair: boolean(input.highlightActiveBracketPair, this.defaultValue.highlightActiveBracketPair),

indentation: boolean(input.indentation, this.defaultValue.indentation),
Expand Down
6 changes: 3 additions & 3 deletions src/vs/monaco.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3864,14 +3864,14 @@ declare namespace monaco.editor {
export interface IGuidesOptions {
/**
* Enable rendering of bracket pair guides.
* Defaults to false.
* Defaults to 'none'.
*/
bracketPairs?: 'on' | 'off' | 'active';
bracketPairs?: 'all' | 'active' | 'none';
/**
* Enable rendering of vertical bracket pair guides.
* Defaults to 'active'.
*/
bracketPairsVertical?: 'on' | 'off' | 'active';
bracketPairsHorizontal?: 'all' | 'active' | 'none';
/**
* Enable highlighting of the active bracket pair.
* Defaults to true.
Expand Down

0 comments on commit 2364b8d

Please sign in to comment.