From 7aab3210589783dfacedd32d277ac57f6f0a3ef5 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 29 Jan 2018 11:34:30 +0300 Subject: [PATCH 1/3] Support theming of active line number --- src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts | 6 +++++- src/vs/editor/common/view/editorColorRegistry.ts | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts b/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts index be1f4d60636ac..29611851dd96f 100644 --- a/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts +++ b/src/vs/editor/browser/viewParts/lineNumbers/lineNumbers.ts @@ -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'; @@ -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}; }`); + } }); diff --git a/src/vs/editor/common/view/editorColorRegistry.ts b/src/vs/editor/common/view/editorColorRegistry.ts index 939a99c1d13bd..7aae2e9ce4239 100644 --- a/src/vs/editor/common/view/editorColorRegistry.ts +++ b/src/vs/editor/common/view/editorColorRegistry.ts @@ -19,6 +19,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')); From 344bc6513824e226a9f57d35c7214f4071d548c8 Mon Sep 17 00:00:00 2001 From: Alex Date: Mon, 12 Feb 2018 16:43:21 +0300 Subject: [PATCH 2/3] Set active line number color for default themes --- extensions/theme-abyss/themes/abyss-color-theme.json | 1 + extensions/theme-defaults/themes/dark_defaults.json | 1 + extensions/theme-defaults/themes/light_defaults.json | 1 + extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json | 1 + .../theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json | 1 + extensions/theme-monokai/themes/monokai-color-theme.json | 1 + extensions/theme-quietlight/themes/quietlight-color-theme.json | 1 + extensions/theme-red/themes/Red-color-theme.json | 1 + .../theme-solarized-dark/themes/solarized-dark-color-theme.json | 1 + .../themes/solarized-light-color-theme.json | 1 + .../themes/tomorrow-night-blue-theme.json | 1 + 11 files changed, 11 insertions(+) diff --git a/extensions/theme-abyss/themes/abyss-color-theme.json b/extensions/theme-abyss/themes/abyss-color-theme.json index bae5fd48804e7..3522dabcfb941 100644 --- a/extensions/theme-abyss/themes/abyss-color-theme.json +++ b/extensions/theme-abyss/themes/abyss-color-theme.json @@ -312,6 +312,7 @@ "editorHoverWidget.background": "#000c38", "editorHoverWidget.border": "#004c18", "editorLineNumber.foreground": "#406385", + "editorActiveLineNumber.foreground": "#80a2c2", "editorMarkerNavigation.background": "#060621", "editorMarkerNavigationError.background": "#AB395B", "editorMarkerNavigationWarning.background": "#5B7E7A", diff --git a/extensions/theme-defaults/themes/dark_defaults.json b/extensions/theme-defaults/themes/dark_defaults.json index e15677c62c867..8c225432158fc 100644 --- a/extensions/theme-defaults/themes/dark_defaults.json +++ b/extensions/theme-defaults/themes/dark_defaults.json @@ -5,6 +5,7 @@ "editor.background": "#1E1E1E", "editor.foreground": "#D4D4D4", "editor.inactiveSelectionBackground": "#3A3D41", + "editorActiveLineNumber.foreground": "#8a8a8a", "editorIndentGuide.background": "#404040", "editor.selectionHighlightBackground": "#ADD6FF26", "list.dropBackground": "#383B3D", diff --git a/extensions/theme-defaults/themes/light_defaults.json b/extensions/theme-defaults/themes/light_defaults.json index d11b218b2909b..578cfd2e5920a 100644 --- a/extensions/theme-defaults/themes/light_defaults.json +++ b/extensions/theme-defaults/themes/light_defaults.json @@ -4,6 +4,7 @@ "colors": { "editor.background": "#FFFFFF", "editor.foreground": "#000000", + "editorActiveLineNumber.foreground": "#567983", "editor.inactiveSelectionBackground": "#E5EBF1", "editorIndentGuide.background": "#D3D3D3", "editor.selectionHighlightBackground": "#ADD6FF4D", diff --git a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json index bad21aface9ab..1842d78a37aad 100644 --- a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json +++ b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json @@ -29,6 +29,7 @@ "activityBar.foreground": "#d3af86", "sideBar.background": "#362712", "editor.lineHighlightBackground": "#5e452b", + "editorActiveLineNumber.foreground": "#adadad", "editorCursor.foreground": "#d3af86", "editorWhitespace.foreground": "#a57a4c", "peekViewTitle.background": "#362712", diff --git a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json index cb50d3813e625..12719f10792de 100644 --- a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json +++ b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json @@ -13,6 +13,7 @@ "editor.selectionBackground": "#676b7180", "editor.selectionHighlightBackground": "#575b6180", "editor.lineHighlightBackground": "#303030", + "editorActiveLineNumber.foreground": "#949494", "editor.wordHighlightBackground": "#4747a180", "editor.wordHighlightStrongBackground": "#6767ce80", "editorCursor.foreground": "#c07020", diff --git a/extensions/theme-monokai/themes/monokai-color-theme.json b/extensions/theme-monokai/themes/monokai-color-theme.json index c5a87fd607e1c..4195655576a70 100644 --- a/extensions/theme-monokai/themes/monokai-color-theme.json +++ b/extensions/theme-monokai/themes/monokai-color-theme.json @@ -36,6 +36,7 @@ "badge.background": "#75715E", "badge.foreground": "#f8f8f2", "editorLineNumber.foreground": "#90908a", + "editorActiveLineNumber.foreground": "#c2c2bf", "panelTitle.activeForeground": "#f8f8f2", "panelTitle.activeBorder": "#75715E", "panelTitle.inactiveForeground": "#75715E", diff --git a/extensions/theme-quietlight/themes/quietlight-color-theme.json b/extensions/theme-quietlight/themes/quietlight-color-theme.json index d34cdb01cdb4d..79e832b7eb86b 100644 --- a/extensions/theme-quietlight/themes/quietlight-color-theme.json +++ b/extensions/theme-quietlight/themes/quietlight-color-theme.json @@ -499,6 +499,7 @@ "sideBar.background": "#F2F2F2", "sideBarSectionHeader.background": "#ede8ef", "editorLineNumber.foreground": "#9DA39A", + "editorActiveLineNumber.foreground": "#9769dc", "editorCursor.foreground": "#54494B", "inputOption.activeBorder": "#adafb7", "dropdown.background": "#F5F5F5", diff --git a/extensions/theme-red/themes/Red-color-theme.json b/extensions/theme-red/themes/Red-color-theme.json index 6c964e506d596..59af89f8ece0f 100644 --- a/extensions/theme-red/themes/Red-color-theme.json +++ b/extensions/theme-red/themes/Red-color-theme.json @@ -21,6 +21,7 @@ "editorWhitespace.foreground": "#c10000", "editor.selectionBackground": "#750000", "editorLineNumber.foreground": "#ff777788", + "editorActiveLineNumber.foreground": "#ffbbbb88", "editorWidget.background": "#300000", "editorHoverWidget.background": "#300000", "editorSuggestWidget.background": "#300000", diff --git a/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json b/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json index bfd823e96588e..f4a93e46d231d 100644 --- a/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json +++ b/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json @@ -361,6 +361,7 @@ // "editorHoverWidget.border": "", // "editorLineNumber.foreground": "", // "editorMarkerNavigation.background": "", + "editorActiveLineNumber.foreground": "#949494", "editorMarkerNavigationError.background": "#AB395B", "editorMarkerNavigationWarning.background": "#5B7E7A", // "editorLink.activeForeground": "", diff --git a/extensions/theme-solarized-light/themes/solarized-light-color-theme.json b/extensions/theme-solarized-light/themes/solarized-light-color-theme.json index 6d2b71465838d..c87a8b2655926 100644 --- a/extensions/theme-solarized-light/themes/solarized-light-color-theme.json +++ b/extensions/theme-solarized-light/themes/solarized-light-color-theme.json @@ -354,6 +354,7 @@ "editor.selectionBackground": "#EEE8D5", // "editorIndentGuide.background": "", "editorHoverWidget.background": "#CCC4B0", + "editorActiveLineNumber.foreground": "#567983", // "editorHoverWidget.border": "", // "editorLineNumber.foreground": "", // "editorMarkerNavigation.background": "", diff --git a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json index 7163c4d671aff..1fa832268937f 100644 --- a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json +++ b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json @@ -15,6 +15,7 @@ "editor.foreground": "#ffffff", "editor.selectionBackground": "#003f8e", "editor.lineHighlightBackground": "#00346e", + "editorActiveLineNumber.foreground": "#949494", "editorCursor.foreground": "#ffffff", "editorWhitespace.foreground": "#404f7d", "editorWidget.background": "#001c40", From 7cb01294a957844234273d174ef48ec7336ed828 Mon Sep 17 00:00:00 2001 From: al Date: Thu, 22 Feb 2018 04:10:49 +0300 Subject: [PATCH 3/3] Revert "Set active line number color for default themes" --- extensions/theme-abyss/themes/abyss-color-theme.json | 1 - extensions/theme-defaults/themes/dark_defaults.json | 1 - extensions/theme-defaults/themes/light_defaults.json | 1 - extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json | 1 - .../theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json | 1 - extensions/theme-monokai/themes/monokai-color-theme.json | 1 - extensions/theme-quietlight/themes/quietlight-color-theme.json | 1 - extensions/theme-red/themes/Red-color-theme.json | 1 - .../theme-solarized-dark/themes/solarized-dark-color-theme.json | 1 - .../themes/solarized-light-color-theme.json | 1 - .../themes/tomorrow-night-blue-theme.json | 1 - 11 files changed, 11 deletions(-) diff --git a/extensions/theme-abyss/themes/abyss-color-theme.json b/extensions/theme-abyss/themes/abyss-color-theme.json index 3522dabcfb941..bae5fd48804e7 100644 --- a/extensions/theme-abyss/themes/abyss-color-theme.json +++ b/extensions/theme-abyss/themes/abyss-color-theme.json @@ -312,7 +312,6 @@ "editorHoverWidget.background": "#000c38", "editorHoverWidget.border": "#004c18", "editorLineNumber.foreground": "#406385", - "editorActiveLineNumber.foreground": "#80a2c2", "editorMarkerNavigation.background": "#060621", "editorMarkerNavigationError.background": "#AB395B", "editorMarkerNavigationWarning.background": "#5B7E7A", diff --git a/extensions/theme-defaults/themes/dark_defaults.json b/extensions/theme-defaults/themes/dark_defaults.json index 8c225432158fc..e15677c62c867 100644 --- a/extensions/theme-defaults/themes/dark_defaults.json +++ b/extensions/theme-defaults/themes/dark_defaults.json @@ -5,7 +5,6 @@ "editor.background": "#1E1E1E", "editor.foreground": "#D4D4D4", "editor.inactiveSelectionBackground": "#3A3D41", - "editorActiveLineNumber.foreground": "#8a8a8a", "editorIndentGuide.background": "#404040", "editor.selectionHighlightBackground": "#ADD6FF26", "list.dropBackground": "#383B3D", diff --git a/extensions/theme-defaults/themes/light_defaults.json b/extensions/theme-defaults/themes/light_defaults.json index 578cfd2e5920a..d11b218b2909b 100644 --- a/extensions/theme-defaults/themes/light_defaults.json +++ b/extensions/theme-defaults/themes/light_defaults.json @@ -4,7 +4,6 @@ "colors": { "editor.background": "#FFFFFF", "editor.foreground": "#000000", - "editorActiveLineNumber.foreground": "#567983", "editor.inactiveSelectionBackground": "#E5EBF1", "editorIndentGuide.background": "#D3D3D3", "editor.selectionHighlightBackground": "#ADD6FF4D", diff --git a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json index 1842d78a37aad..bad21aface9ab 100644 --- a/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json +++ b/extensions/theme-kimbie-dark/themes/kimbie-dark-color-theme.json @@ -29,7 +29,6 @@ "activityBar.foreground": "#d3af86", "sideBar.background": "#362712", "editor.lineHighlightBackground": "#5e452b", - "editorActiveLineNumber.foreground": "#adadad", "editorCursor.foreground": "#d3af86", "editorWhitespace.foreground": "#a57a4c", "peekViewTitle.background": "#362712", diff --git a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json index 12719f10792de..cb50d3813e625 100644 --- a/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json +++ b/extensions/theme-monokai-dimmed/themes/dimmed-monokai-color-theme.json @@ -13,7 +13,6 @@ "editor.selectionBackground": "#676b7180", "editor.selectionHighlightBackground": "#575b6180", "editor.lineHighlightBackground": "#303030", - "editorActiveLineNumber.foreground": "#949494", "editor.wordHighlightBackground": "#4747a180", "editor.wordHighlightStrongBackground": "#6767ce80", "editorCursor.foreground": "#c07020", diff --git a/extensions/theme-monokai/themes/monokai-color-theme.json b/extensions/theme-monokai/themes/monokai-color-theme.json index 4195655576a70..c5a87fd607e1c 100644 --- a/extensions/theme-monokai/themes/monokai-color-theme.json +++ b/extensions/theme-monokai/themes/monokai-color-theme.json @@ -36,7 +36,6 @@ "badge.background": "#75715E", "badge.foreground": "#f8f8f2", "editorLineNumber.foreground": "#90908a", - "editorActiveLineNumber.foreground": "#c2c2bf", "panelTitle.activeForeground": "#f8f8f2", "panelTitle.activeBorder": "#75715E", "panelTitle.inactiveForeground": "#75715E", diff --git a/extensions/theme-quietlight/themes/quietlight-color-theme.json b/extensions/theme-quietlight/themes/quietlight-color-theme.json index 79e832b7eb86b..d34cdb01cdb4d 100644 --- a/extensions/theme-quietlight/themes/quietlight-color-theme.json +++ b/extensions/theme-quietlight/themes/quietlight-color-theme.json @@ -499,7 +499,6 @@ "sideBar.background": "#F2F2F2", "sideBarSectionHeader.background": "#ede8ef", "editorLineNumber.foreground": "#9DA39A", - "editorActiveLineNumber.foreground": "#9769dc", "editorCursor.foreground": "#54494B", "inputOption.activeBorder": "#adafb7", "dropdown.background": "#F5F5F5", diff --git a/extensions/theme-red/themes/Red-color-theme.json b/extensions/theme-red/themes/Red-color-theme.json index 59af89f8ece0f..6c964e506d596 100644 --- a/extensions/theme-red/themes/Red-color-theme.json +++ b/extensions/theme-red/themes/Red-color-theme.json @@ -21,7 +21,6 @@ "editorWhitespace.foreground": "#c10000", "editor.selectionBackground": "#750000", "editorLineNumber.foreground": "#ff777788", - "editorActiveLineNumber.foreground": "#ffbbbb88", "editorWidget.background": "#300000", "editorHoverWidget.background": "#300000", "editorSuggestWidget.background": "#300000", diff --git a/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json b/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json index f4a93e46d231d..bfd823e96588e 100644 --- a/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json +++ b/extensions/theme-solarized-dark/themes/solarized-dark-color-theme.json @@ -361,7 +361,6 @@ // "editorHoverWidget.border": "", // "editorLineNumber.foreground": "", // "editorMarkerNavigation.background": "", - "editorActiveLineNumber.foreground": "#949494", "editorMarkerNavigationError.background": "#AB395B", "editorMarkerNavigationWarning.background": "#5B7E7A", // "editorLink.activeForeground": "", diff --git a/extensions/theme-solarized-light/themes/solarized-light-color-theme.json b/extensions/theme-solarized-light/themes/solarized-light-color-theme.json index c87a8b2655926..6d2b71465838d 100644 --- a/extensions/theme-solarized-light/themes/solarized-light-color-theme.json +++ b/extensions/theme-solarized-light/themes/solarized-light-color-theme.json @@ -354,7 +354,6 @@ "editor.selectionBackground": "#EEE8D5", // "editorIndentGuide.background": "", "editorHoverWidget.background": "#CCC4B0", - "editorActiveLineNumber.foreground": "#567983", // "editorHoverWidget.border": "", // "editorLineNumber.foreground": "", // "editorMarkerNavigation.background": "", diff --git a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json index 1fa832268937f..7163c4d671aff 100644 --- a/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json +++ b/extensions/theme-tomorrow-night-blue/themes/tomorrow-night-blue-theme.json @@ -15,7 +15,6 @@ "editor.foreground": "#ffffff", "editor.selectionBackground": "#003f8e", "editor.lineHighlightBackground": "#00346e", - "editorActiveLineNumber.foreground": "#949494", "editorCursor.foreground": "#ffffff", "editorWhitespace.foreground": "#404f7d", "editorWidget.background": "#001c40",