Skip to content

Commit

Permalink
Merge pull request #42301 from usernamehw/theming_active_line_number
Browse files Browse the repository at this point in the history
Support theming of active line number
  • Loading branch information
rebornix authored Feb 23, 2018
2 parents 3573b8e + 7cb0129 commit 9af08ba
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
'use strict';

import 'vs/css!./lineNumbers';
import { editorLineNumbers } from 'vs/editor/common/view/editorColorRegistry';
import { editorLineNumbers, editorActiveLineNumber } from 'vs/editor/common/view/editorColorRegistry';
import { registerThemingParticipant } from 'vs/platform/theme/common/themeService';
import * as platform from 'vs/base/common/platform';
import { DynamicViewOverlay } from 'vs/editor/browser/view/dynamicViewOverlay';
Expand Down Expand Up @@ -175,4 +175,8 @@ registerThemingParticipant((theme, collector) => {
if (lineNumbers) {
collector.addRule(`.monaco-editor .line-numbers { color: ${lineNumbers}; }`);
}
const activeLineNumber = theme.getColor(editorActiveLineNumber);
if (activeLineNumber) {
collector.addRule(`.monaco-editor .current-line-margin ~ .line-numbers { color: ${activeLineNumber}; }`);
}
});
1 change: 1 addition & 0 deletions src/vs/editor/common/view/editorColorRegistry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ export const editorCursorBackground = registerColor('editorCursor.background', n
export const editorWhitespaces = registerColor('editorWhitespace.foreground', { dark: '#e3e4e229', light: '#33333333', hc: '#e3e4e229' }, nls.localize('editorWhitespaces', 'Color of whitespace characters in the editor.'));
export const editorIndentGuides = registerColor('editorIndentGuide.background', { dark: editorWhitespaces, light: editorWhitespaces, hc: editorWhitespaces }, nls.localize('editorIndentGuides', 'Color of the editor indentation guides.'));
export const editorLineNumbers = registerColor('editorLineNumber.foreground', { dark: '#5A5A5A', light: '#2B91AF', hc: Color.white }, nls.localize('editorLineNumbers', 'Color of editor line numbers.'));
export const editorActiveLineNumber = registerColor('editorActiveLineNumber.foreground', { dark: null, light: null, hc: null }, nls.localize('editorActiveLineNumber', 'Color of editor active line number'));
export const editorRuler = registerColor('editorRuler.foreground', { dark: '#5A5A5A', light: Color.lightgrey, hc: Color.white }, nls.localize('editorRuler', 'Color of the editor rulers.'));

export const editorCodeLensForeground = registerColor('editorCodeLens.foreground', { dark: '#999999', light: '#999999', hc: '#999999' }, nls.localize('editorCodeLensForeground', 'Foreground color of editor code lenses'));
Expand Down

0 comments on commit 9af08ba

Please sign in to comment.