mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fixes #143484
This commit is contained in:
parent
26f019d919
commit
1ccee4ae21
|
@ -190,7 +190,7 @@ export class IndentGuidesOverlay extends DynamicViewOverlay {
|
|||
let activeIndentEndLineNumber = 0;
|
||||
let activeIndentLevel = 0;
|
||||
|
||||
if (this._bracketPairGuideOptions.highlightActiveIndentation && activeCursorPosition) {
|
||||
if (this._bracketPairGuideOptions.highlightActiveIndentation !== false && activeCursorPosition) {
|
||||
const activeIndentInfo = this._context.viewModel.getActiveIndentGuide(activeCursorPosition.lineNumber, visibleStartLineNumber, visibleEndLineNumber);
|
||||
activeIndentStartLineNumber = activeIndentInfo.startLineNumber;
|
||||
activeIndentEndLineNumber = activeIndentInfo.endLineNumber;
|
||||
|
@ -213,7 +213,7 @@ export class IndentGuidesOverlay extends DynamicViewOverlay {
|
|||
const indentGuide = (indentLvl - 1) * indentSize + 1;
|
||||
const isActive =
|
||||
// Disable active indent guide if there are bracket guides.
|
||||
bracketGuidesInLine.length === 0 &&
|
||||
(this._bracketPairGuideOptions.highlightActiveIndentation === 'always' || bracketGuidesInLine.length === 0) &&
|
||||
activeIndentStartLineNumber <= lineNumber &&
|
||||
lineNumber <= activeIndentEndLineNumber &&
|
||||
indentLvl === activeIndentLevel;
|
||||
|
|
|
@ -3693,7 +3693,7 @@ export interface IGuidesOptions {
|
|||
* Enable highlighting of the active indent guide.
|
||||
* Defaults to true.
|
||||
*/
|
||||
highlightActiveIndentation?: boolean;
|
||||
highlightActiveIndentation?: boolean | 'always';
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -3751,8 +3751,15 @@ class GuideOptions extends BaseEditorOption<EditorOption.guides, IGuidesOptions,
|
|||
description: nls.localize('editor.guides.indentation', "Controls whether the editor should render indent guides.")
|
||||
},
|
||||
'editor.guides.highlightActiveIndentation': {
|
||||
type: 'boolean',
|
||||
type: ['boolean', 'string'],
|
||||
enum: [true, 'always', false],
|
||||
enumDescriptions: [
|
||||
nls.localize('editor.guides.highlightActiveIndentation.true', "Highlights the active indent guide."),
|
||||
nls.localize('editor.guides.highlightActiveIndentation.always', "Highlights the active indent guide even if bracket guides are highlighted."),
|
||||
nls.localize('editor.guides.highlightActiveIndentation.false', "Do not highlight the active indent guide."),
|
||||
],
|
||||
default: defaults.highlightActiveIndentation,
|
||||
|
||||
description: nls.localize('editor.guides.highlightActiveIndentation', "Controls whether the editor should highlight the active indent guide.")
|
||||
}
|
||||
}
|
||||
|
@ -3770,7 +3777,7 @@ class GuideOptions extends BaseEditorOption<EditorOption.guides, IGuidesOptions,
|
|||
highlightActiveBracketPair: boolean(input.highlightActiveBracketPair, this.defaultValue.highlightActiveBracketPair),
|
||||
|
||||
indentation: boolean(input.indentation, this.defaultValue.indentation),
|
||||
highlightActiveIndentation: boolean(input.highlightActiveIndentation, this.defaultValue.highlightActiveIndentation),
|
||||
highlightActiveIndentation: primitiveSet(input.highlightActiveIndentation, this.defaultValue.highlightActiveIndentation, [true, false, 'always']),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
|
2
src/vs/monaco.d.ts
vendored
2
src/vs/monaco.d.ts
vendored
|
@ -4032,7 +4032,7 @@ declare namespace monaco.editor {
|
|||
* Enable highlighting of the active indent guide.
|
||||
* Defaults to true.
|
||||
*/
|
||||
highlightActiveIndentation?: boolean;
|
||||
highlightActiveIndentation?: boolean | 'always';
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in a new issue