diff options
| author | mitchell <unknown> | 2020-07-07 20:14:11 -0400 |
|---|---|---|
| committer | mitchell <unknown> | 2020-07-07 20:14:11 -0400 |
| commit | 329559b74b483576a74d5f87eebf951bd12b9200 (patch) | |
| tree | 4a200348748ccfdd27d1a3f8c0352758b9f9f4c8 /lexlua/themes/curses.lua | |
| parent | 5f930428f724eef7dd0be4706670039b89f3523e (diff) | |
| download | scintilla-mirror-329559b74b483576a74d5f87eebf951bd12b9200.tar.gz | |
lexlua: Added `lexer.colors` and `lexer.styles` tables for themes and lexers.
This allows for a more Lua table-oriented approach to defining and using colors
and styles, instead of manually manipulating Scintilla property strings.
Themes and lexers are still backwards compatible, as the underlying mechanisms
are still in place.
Diffstat (limited to 'lexlua/themes/curses.lua')
| -rw-r--r-- | lexlua/themes/curses.lua | 84 |
1 files changed, 43 insertions, 41 deletions
diff --git a/lexlua/themes/curses.lua b/lexlua/themes/curses.lua index 1ac1928df..b0d6066db 100644 --- a/lexlua/themes/curses.lua +++ b/lexlua/themes/curses.lua @@ -2,54 +2,56 @@ -- Curses theme for Lua lexers. -- Contributions by Ana Balan. -local property = require('lexer').property +local lexer = require('lexer') +local colors, styles = lexer.colors, lexer.styles -- Normal colors. -property['color.black'] = '#000000' -property['color.red'] = '#800000' -property['color.green'] = '#008000' -property['color.yellow'] = '#808000' -property['color.blue'] = '#000080' -property['color.magenta'] = '#800080' -property['color.cyan'] = '#008080' -property['color.white'] = '#C0C0C0' +colors.black = '#000000' +colors.red = '#800000' +colors.green = '#008000' +colors.yellow = '#808000' +colors.blue = '#000080' +colors.magenta = '#800080' +colors.cyan = '#008080' +colors.white = '#C0C0C0' -- Light colors. (16 color terminals only.) -- These only apply to 16 color terminals. For other terminals, set the -- style's `bold` attribute to use the light color variant. -property['color.light_black'] = '#404040' -property['color.light_red'] = '#FF0000' -property['color.light_green'] = '#00FF00' ---property['color.light_yellow'] = '#FFFF00' -property['color.light_blue'] = '#0000FF' -property['color.light_magenta'] = '#FF00FF' ---property['color.light_cyan'] = '#0000FF' -property['color.light_white'] = '#FFFFFF' +colors.light_black = '#404040' +colors.light_red = '#FF0000' +colors.light_green = '#00FF00' +colors.light_yellow = '#FFFF00' +colors.light_blue = '#0000FF' +colors.light_magenta = '#FF00FF' +colors.light_cyan = '#0000FF' +colors.light_white = '#FFFFFF' -- Predefined styles. -property['style.default'] = 'fore:$(color.white),back:$(color.black)' -property['style.linenumber'] = '' -property['style.bracelight'] = 'fore:$(color.black),back:$(color.white)' -property['style.controlchar'] = '' -property['style.indentguide'] = '' -property['style.calltip'] = '$(style.default)' -property['style.folddisplaytext'] = 'fore:$(color.black),bold' +styles.default = {fore = colors.white, back = colors.black} +styles.line_number = {fore = colors.black, bold = true} +styles.brace_light = {fore = colors.black, back = colors.white} +styles.control_char = {} +styles.indent_guide = {} +styles.call_tip = {} +styles.fold_display_text = {fore = colors.black, bold = true} -- Token styles. -property['style.class'] = 'fore:$(color.yellow)' -property['style.comment'] = 'fore:$(color.black),bold' -property['style.constant'] = 'fore:$(color.red)' -property['style.embedded'] = '$(style.keyword),back:$(color.black)' -property['style.error'] = 'fore:$(color.red),bold' -property['style.function'] = 'fore:$(color.blue)' -property['style.identifier'] = '' -property['style.keyword'] = 'fore:$(color.white),bold' -property['style.label'] = 'fore:$(color.red),bold' -property['style.number'] = 'fore:$(color.cyan)' -property['style.operator'] = 'fore:$(color.yellow)' -property['style.preprocessor'] = 'fore:$(color.magenta)' -property['style.regex'] = 'fore:$(color.green),bold' -property['style.string'] = 'fore:$(color.green)' -property['style.type'] = 'fore:$(color.magenta),bold' -property['style.variable'] = 'fore:$(color.blue),bold' -property['style.whitespace'] = '' +styles.class = {fore = colors.yellow} +styles.comment = {fore = colors.black, bold = true} +styles.constant = {fore = colors.red} +styles.embedded = {fore = colors.white, bold = true, back = colors.black} +styles.error = {fore = colors.red, bold = true} +styles['function'] = {fore = colors.blue} +styles.identifier = {} +styles.keyword = {fore = colors.white, bold = true} +styles.label = {fore = colors.red, bold = true} +styles.number = {fore = colors.cyan} +styles.operator = {fore = colors.yellow} +styles.preprocessor = {fore = colors.magenta} +styles.regex = {fore = colors.green, bold = true} +styles.string = {fore = colors.green} +styles.type = {fore = colors.magenta, bold = true} +styles.variable = {fore = colors.blue, bold = true} +styles.whitespace = {} + |
