aboutsummaryrefslogtreecommitdiff
path: root/editors/code/src/highlighting.ts
diff options
context:
space:
mode:
Diffstat (limited to 'editors/code/src/highlighting.ts')
-rw-r--r--editors/code/src/highlighting.ts30
1 files changed, 27 insertions, 3 deletions
diff --git a/editors/code/src/highlighting.ts b/editors/code/src/highlighting.ts
index 14199dbea..0a38c9ef6 100644
--- a/editors/code/src/highlighting.ts
+++ b/editors/code/src/highlighting.ts
@@ -30,9 +30,33 @@ function createDecorationFromTextmate(
30): vscode.TextEditorDecorationType { 30): vscode.TextEditorDecorationType {
31 const decorationOptions: vscode.DecorationRenderOptions = {}; 31 const decorationOptions: vscode.DecorationRenderOptions = {};
32 decorationOptions.rangeBehavior = vscode.DecorationRangeBehavior.OpenOpen; 32 decorationOptions.rangeBehavior = vscode.DecorationRangeBehavior.OpenOpen;
33 decorationOptions.color = themeStyle.foreground; 33
34 decorationOptions.backgroundColor = themeStyle.background; 34 if (themeStyle.foreground) {
35 decorationOptions.fontStyle = themeStyle.fontStyle; 35 decorationOptions.color = themeStyle.foreground;
36 }
37
38 if (themeStyle.background) {
39 decorationOptions.backgroundColor = themeStyle.background;
40 }
41
42 if (themeStyle.fontStyle) {
43 const parts: string[] = themeStyle.fontStyle.split(' ');
44 parts.forEach(part => {
45 switch (part) {
46 case 'italic':
47 decorationOptions.fontStyle = 'italic';
48 break;
49 case 'bold':
50 decorationOptions.fontWeight = 'bold';
51 break;
52 case 'underline':
53 decorationOptions.textDecoration = 'underline';
54 break;
55 default:
56 break;
57 }
58 });
59 }
36 return vscode.window.createTextEditorDecorationType(decorationOptions); 60 return vscode.window.createTextEditorDecorationType(decorationOptions);
37} 61}
38 62