1local info = {
2 version = 1.002,
3 comment = "theme for scintilla lpeg lexer for context/metafun",
4 author = "Hans Hagen, PRAGMA-ADE, Hasselt NL",
5 copyright = "PRAGMA ADE / ConTeXt Development Team",
6 license = "see context related readme files",
7}
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34if not lexers or not lexers.initialized then
35
36 local font_name = 'Dejavu Sans Mono'
37 local font_size = '14'
38
39 local colors = {
40 red = { 0x7F, 0x00, 0x00 },
41 green = { 0x00, 0x7F, 0x00 },
42 blue = { 0x00, 0x00, 0x7F },
43 cyan = { 0x00, 0x7F, 0x7F },
44 magenta = { 0x7F, 0x00, 0x7F },
45 yellow = { 0x7F, 0x7F, 0x00 },
46 orange = { 0xB0, 0x7F, 0x00 },
47
48 white = { 0xFF },
49 light = { 0xCF },
50 grey = { 0x80 },
51 dark = { 0x4F },
52 black = { 0x00 },
53
54 selection = { 0xF7 },
55 logpanel = { 0xE7 },
56 textpanel = { 0xCF },
57 linepanel = { 0xA7 },
58 tippanel = { 0x44 },
59
60 right = { 0x00, 0x00, 0xFF },
61 wrong = { 0xFF, 0x00, 0x00 },
62 }
63
64 local styles = {
65
66 ["whitespace"] = { },
67
68
69 ["default"] = { font = font_name, size = font_size, fore = colors.black,
70 back = textadept and colors.textpanel or nil },
71 ["number"] = { fore = colors.cyan },
72 ["comment"] = { fore = colors.yellow },
73 ["keyword"] = { fore = colors.blue, bold = true },
74 ["string"] = { fore = colors.magenta },
75
76 ["error"] = { fore = colors.red },
77 ["label"] = { fore = colors.red, bold = true },
78
79 ["nothing"] = { },
80 ["class"] = { fore = colors.black, bold = true },
81 ["function"] = { fore = colors.black, bold = true },
82 ["constant"] = { fore = colors.cyan, bold = true },
83 ["operator"] = { fore = colors.blue },
84 ["regex"] = { fore = colors.magenta },
85 ["preprocessor"] = { fore = colors.yellow, bold = true },
86 ["tag"] = { fore = colors.cyan },
87 ["type"] = { fore = colors.blue },
88 ["variable"] = { fore = colors.black },
89 ["identifier"] = { },
90
91 ["linenumber"] = { back = colors.linepanel },
92 ["bracelight"] = { fore = colors.orange, bold = true },
93 ["bracebad"] = { fore = colors.orange, bold = true },
94 ["controlchar"] = { },
95 ["indentguide"] = { fore = colors.linepanel, back = colors.white },
96 ["calltip"] = { fore = colors.white, back = colors.tippanel },
97
98 ["invisible"] = { back = colors.orange },
99 ["quote"] = { fore = colors.blue, bold = true },
100 ["special"] = { fore = colors.blue },
101 ["extra"] = { fore = colors.yellow },
102 ["embedded"] = { fore = colors.black, bold = true },
103 ["char"] = { fore = colors.magenta },
104 ["reserved"] = { fore = colors.magenta, bold = true },
105 ["definition"] = { fore = colors.black, bold = true },
106 ["okay"] = { fore = colors.dark },
107 ["warning"] = { fore = colors.orange },
108 ["standout"] = { fore = colors.orange, bold = true },
109 ["command"] = { fore = colors.green, bold = true },
110 ["internal"] = { fore = colors.orange, bold = true },
111 ["preamble"] = { fore = colors.yellow },
112 ["grouping"] = { fore = colors.red },
113 ["primitive"] = { fore = colors.blue, bold = true },
114 ["plain"] = { fore = colors.dark, bold = true },
115 ["user"] = { fore = colors.green },
116 ["data"] = { fore = colors.cyan, bold = true },
117
118
119
120 ["text"] = { font = font_name, size = font_size, fore = colors.black, back = colors.textpanel },
121 ["text"] = { font = font_name, size = font_size, fore = colors.black },
122
123 }
124
125 local properties = {
126 ["fold.by.parsing"] = 1,
127 ["fold.by.indentation"] = 0,
128 ["fold.by.line"] = 0,
129 ["fold.line.comments"] = 0,
130
131 ["lexer.context.log"] = 1,
132 ["lexer.context.trace"] = 0,
133 ["lexer.context.detail"] = 0,
134 ["lexer.context.show"] = 0,
135 ["lexer.context.collapse"] = 0,
136 ["lexer.context.inspect"] = 0,
137
138
139
140 }
141
142
143 local lexer = require("scite-context-lexer")
144 local context = lexer.context
145
146 if context then
147 context.inform("loading context (style) properties")
148 if context.registerstyles then
149 context.registerstyles(styles)
150 end
151 if context.registercolors then
152 context.registercolors(colors)
153 end
154 if context.registerproperties then
155 context.registerproperties(properties)
156 end
157 end
158
159end
160 |