diff --git a/src/vs/editor/contrib/folding/folding.ts b/src/vs/editor/contrib/folding/folding.ts index e1bbbf1b520fd762575800b9f5583e1c650797ef..3e18219d6b8061c7555ea513a5f0d78ca2176a83 100644 --- a/src/vs/editor/contrib/folding/folding.ts +++ b/src/vs/editor/contrib/folding/folding.ts @@ -32,6 +32,8 @@ import { InitializingRangeProvider, ID_INIT_PROVIDER } from 'vs/editor/contrib/f import { KeybindingWeight } from 'vs/platform/keybinding/common/keybindingsRegistry'; import { onUnexpectedError } from 'vs/base/common/errors'; import { RawContextKey, IContextKey, IContextKeyService } from 'vs/platform/contextkey/common/contextkey'; +import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; +import { registerColor, editorSelectionBackground, transparent } from 'vs/platform/theme/common/colorRegistry'; const CONTEXT_FOLDING_ENABLED = new RawContextKey('foldingEnabled', false); @@ -884,3 +886,12 @@ for (let i = 1; i <= 7; i++) { }) ); } + +export const foldBackgroundBackground = registerColor('editor.foldBackground', { light: transparent(editorSelectionBackground, 0.3), dark: transparent(editorSelectionBackground, 0.3), hc: null }, nls.localize('editorSelectionBackground', "Color of the editor selection.")); + +registerThemingParticipant((theme, collector) => { + const foldBackground = theme.getColor(foldBackgroundBackground); + if (foldBackground) { + collector.addRule(`.monaco-editor .folded-background { background-color: ${foldBackground}; }`); + } +}); diff --git a/src/vs/editor/contrib/folding/foldingModel.ts b/src/vs/editor/contrib/folding/foldingModel.ts index 386c923f8344a96ecf292b4b5a669c3d4487f6b8..9a91caa023567aa40298036f213cfb52062bf863 100644 --- a/src/vs/editor/contrib/folding/foldingModel.ts +++ b/src/vs/editor/contrib/folding/foldingModel.ts @@ -6,9 +6,6 @@ import { ITextModel, IModelDecorationOptions, IModelDeltaDecoration, IModelDecorationsChangeAccessor } from 'vs/editor/common/model'; import { Event, Emitter } from 'vs/base/common/event'; import { FoldingRegions, ILineRange, FoldingRegion } from './foldingRanges'; -import { registerThemingParticipant } from 'vs/platform/theme/common/themeService'; -import { registerColor, editorSelectionBackground, darken, lighten } from 'vs/platform/theme/common/colorRegistry'; -import * as nls from 'vs/nls'; export interface IDecorationProvider { getDecorationOption(isCollapsed: boolean): IModelDecorationOptions; @@ -357,12 +354,3 @@ export function setCollapseStateForType(foldingModel: FoldingModel, type: string } foldingModel.toggleCollapseState(toToggle); } - -export const foldBackgroundBackground = registerColor('editor.foldBackground', { light: lighten(editorSelectionBackground, 0.5), dark: darken(editorSelectionBackground, 0.5), hc: null }, nls.localize('editorSelectionBackground', "Color of the editor selection.")); - -registerThemingParticipant((theme, collector) => { - const foldBackground = theme.getColor(foldBackgroundBackground); - if (foldBackground) { - collector.addRule(`.monaco-editor .folded-background { background-color: ${foldBackground}; }`); - } -});