diff options
author | 2011-11-23 06:25:48 -0500 | |
---|---|---|
committer | 2011-11-23 06:25:48 -0500 | |
commit | 10cd8e9477e9e3ead6c12110bcc9f67924f540cd (patch) | |
tree | ce8045dc01c4261cc54164a9440ebccd6c06b0dd | |
parent | 1859dff605a32d9e78a36c14239129579d9fc6e4 (diff) | |
download | textadept-10cd8e9477e9e3ead6c12110bcc9f67924f540cd.tar.gz textadept-10cd8e9477e9e3ead6c12110bcc9f67924f540cd.zip |
Added theme utilities, modified light and dark themes, and removed scite theme.
Added gui.set_theme() and gui.select_theme() theming utilities.
All new light and dark themes. Moved old classic themes to the wiki.
-rw-r--r-- | core/._G.luadoc | 1 | ||||
-rw-r--r-- | core/.gui.luadoc | 15 | ||||
-rw-r--r-- | core/gui.lua | 89 | ||||
-rw-r--r-- | core/init.lua | 13 | ||||
-rw-r--r-- | core/locale.conf | 2 | ||||
-rw-r--r-- | core/locales/locale.ru.conf | 2 | ||||
-rw-r--r-- | doc/manual/14_Appendix.md | 1 | ||||
-rw-r--r-- | doc/manual/8_Themes.md | 39 | ||||
-rw-r--r-- | doc/manual/images/scitetheme.png | bin | 29966 -> 0 bytes | |||
-rw-r--r-- | modules/textadept/bookmarks.lua | 2 | ||||
-rw-r--r-- | modules/textadept/editing.lua | 2 | ||||
-rw-r--r-- | modules/textadept/keys.lua | 5 | ||||
-rw-r--r-- | modules/textadept/menu.lua | 2 | ||||
-rw-r--r--[-rwxr-xr-x] | themes/dark/buffer.lua | 0 | ||||
-rw-r--r-- | themes/dark/lexer.lua | 106 | ||||
-rw-r--r--[-rwxr-xr-x] | themes/dark/view.lua | 20 | ||||
-rw-r--r--[-rwxr-xr-x] | themes/light/buffer.lua | 0 | ||||
-rw-r--r-- | themes/light/lexer.lua | 111 | ||||
-rw-r--r--[-rwxr-xr-x] | themes/light/view.lua | 18 | ||||
-rwxr-xr-x | themes/scite/buffer.lua | 16 | ||||
-rw-r--r-- | themes/scite/lexer.lua | 63 | ||||
-rwxr-xr-x | themes/scite/view.lua | 119 |
22 files changed, 290 insertions, 336 deletions
diff --git a/core/._G.luadoc b/core/._G.luadoc index 94de2a73..09749436 100644 --- a/core/._G.luadoc +++ b/core/._G.luadoc @@ -12,7 +12,6 @@ module('_G') -- * `_LEXERPATH` [string]: Paths to lexers, formatted like -- [`package.path`][package_path]. -- * `_RELEASE` [string]: The Textadept release version. --- * `_THEME` [string]: The [theme](../manual/8_Themes.lua) file to use. -- * `_USERHOME` [string]: Path to the user's `~/.textadept/`. -- * `_CHARSET` [string]: The character set encoding of the filesystem. This is -- used in [File I/O](../modules/io.html). diff --git a/core/.gui.luadoc b/core/.gui.luadoc index deb39d58..94edc031 100644 --- a/core/.gui.luadoc +++ b/core/.gui.luadoc @@ -107,3 +107,18 @@ function dialog(kind, ...) end -- @usage gui.filteredlist('Title', { 'Foo', 'Bar' }, { 'a', 'b', 'c', 'd' }, -- false, '--output-column', '2') function filteredlist(title, columns, items, int_return, ...) end + +--- +-- Sets the editor theme from the given name. +-- Themes in `_USERHOME/themes/` are checked first, followed by `_HOME/themes/`. +-- If the name contains slashes ('/' on Linux and Mac OSX and '\' on Win32), it +-- is assumed to be an absolute path so `_USERHOME` and `_HOME` are not checked. +-- Throws an error if the theme is not found. Any errors in the theme are +-- printed to `io.stderr`. +-- @param name The name or absolute path of a theme. If nil, sets the default +-- theme. +function set_theme(name) end + +--- +-- Prompts the user to select an editor theme from a filtered list. +function select_theme() end diff --git a/core/gui.lua b/core/gui.lua index 0beb1a11..3ebc63e5 100644 --- a/core/gui.lua +++ b/core/gui.lua @@ -3,7 +3,8 @@ local L = locale.localize local gui = gui --- LuaDoc is in core/.gui.luadoc. +-- Helper function for printing messages to buffers. +-- @see gui._print local function _print(buffer_type, ...) if buffer._type ~= buffer_type then for i, view in ipairs(_VIEWS) do @@ -78,6 +79,74 @@ function gui.goto_file(filename, split, preferred_view) io.open_file(filename) end +local THEME +-- LuaDoc is in core/.gui.luadoc. +function gui.set_theme(name) + if not name then + -- Read theme from ~/.textadept/theme, defaulting to 'light'. + local f = io.open(_USERHOME..'/theme', 'rb') + if f then + name = f:read('*line'):match('[^\r\n]+') + f:close() + end + if not name or name == '' then name = 'light' end + end + + -- Get the path of the theme. + local theme + if not name:find('[/\\]') then + if lfs.attributes(_USERHOME..'/themes/'..name) then + theme = _USERHOME..'/themes/'..name + elseif lfs.attributes(_HOME..'/themes/'..name) then + theme = _HOME..'/themes/'..name + end + elseif lfs.attributes(name) then + theme = name + end + if not theme then error(('"%s" %s'):format(name, L("theme not found."))) end + + if buffer and view then + local current_buffer, current_view = _BUFFERS[buffer], _VIEWS[view] + for i in ipairs(_BUFFERS) do + view:goto_buffer(i) + buffer.property['lexer.lpeg.color.theme'] = theme..'/lexer.lua' + local lexer = buffer:get_lexer() + buffer:set_lexer('null') -- lexer needs to be changed to reset styles + buffer:set_lexer(lexer) + local ok, err = pcall(dofile, theme..'/buffer.lua') + if not ok then io.stderr:write(err) end + end + view:goto_buffer(current_buffer) + for i in ipairs(_VIEWS) do + gui.goto_view(i) + local lexer = buffer:get_lexer() + buffer:set_lexer('null') -- lexer needs to be changed to reset styles + buffer:set_lexer(lexer) + local ok, err = pcall(dofile, theme..'/view.lua') + if not ok then io.stderr:write(err) end + end + gui.goto_view(current_view) + end + THEME = theme +end + +-- LuaDoc is in core/.gui.luadoc. +function gui.select_theme() + local themes, themes_found = {}, {} + for theme in lfs.dir(_HOME..'/themes') do + if not theme:find('^%.%.?$') then themes_found[theme] = true end + end + if lfs.attributes(_USERHOME..'/themes') then + for theme in lfs.dir(_USERHOME..'/themes') do + if not theme:find('^%.%.?$') then themes_found[theme] = true end + end + end + for theme in pairs(themes_found) do themes[#themes + 1] = theme end + table.sort(themes) + local theme = gui.filteredlist(L('Select Theme'), L('Name'), themes) + if theme then gui.set_theme(theme) end +end + local connect = events.connect -- Sets default properties for a Scintilla window. @@ -96,11 +165,9 @@ connect(events.VIEW_NEW, function() for _, key in ipairs(ctrl_shift_keys) do buffer:clear_cmd_key(string.byte(key), c.SCMOD_CTRL + c.SCMOD_SHIFT) end - - if _THEME and #_THEME > 0 then - local ok, err = pcall(dofile, _THEME..'/view.lua') - if not ok then io.stderr:write(err) end - end + -- Load theme. + local ok, err = pcall(dofile, THEME..'/view.lua') + if not ok then io.stderr:write(err) end end) connect(events.VIEW_NEW, function() events.emit(events.UPDATE_UI) end) @@ -119,16 +186,12 @@ local function set_properties() buffer.property['textadept.home'] = _HOME buffer.property['lexer.lpeg.home'] = _LEXERPATH buffer.property['lexer.lpeg.script'] = _HOME..'/lexers/lexer.lua' - if _THEME and #_THEME > 0 then - buffer.property['lexer.lpeg.color.theme'] = _THEME..'/lexer.lua' - end + buffer.property['lexer.lpeg.color.theme'] = THEME..'/lexer.lua' -- Buffer. buffer.code_page = _SCINTILLA.constants.SC_CP_UTF8 -- Load theme. - if _THEME and #_THEME > 0 then - local ok, err = pcall(dofile, _THEME..'/buffer.lua') - if not ok then io.stderr:write(err) end - end + local ok, err = pcall(dofile, THEME..'/buffer.lua') + if not ok then io.stderr:write(err) end end -- Sets default properties for a Scintilla document. diff --git a/core/init.lua b/core/init.lua index 97628b33..9dac66fb 100644 --- a/core/init.lua +++ b/core/init.lua @@ -15,18 +15,7 @@ require 'keys' _LEXERPATH = _USERHOME..'/lexers/?.lua;'.._HOME..'/lexers' -_THEME = 'light' -local f = io.open(_USERHOME..'/theme', 'rb') -if f then - local theme = f:read('*line'):match('[^\r\n]+') - f:close() - if theme and #theme > 0 then _THEME = theme end -end -if not _THEME:find('[/\\]') then - local theme = _THEME - _THEME = _USERHOME..'/themes/'..theme - if not lfs.attributes(_THEME) then _THEME = _HOME..'/themes/'..theme end -end +gui.set_theme() -- LuaDoc is in core/._G.luadoc. function user_dofile(filename) diff --git a/core/locale.conf b/core/locale.conf index c272c343..cf9a3e86 100644 --- a/core/locale.conf +++ b/core/locale.conf @@ -37,6 +37,7 @@ Name = Name %File = File Untitled = Untitled Switch Buffers = Switch Buffers +theme not found. = theme not found. CRLF = CRLF CR = CR LF = LF @@ -220,6 +221,7 @@ Toggle Virtual Space = Toggle _Virtual Space Zoom In = Zoom _In Zoom Out = Zoom _Out Reset Zoom = _Reset Zoom +Select Theme... = Select _Theme... Help = _Help Show Manual = Show _Manual Show LuaDoc = Show _LuaDoc diff --git a/core/locales/locale.ru.conf b/core/locales/locale.ru.conf index 8ec93ec1..0b349239 100644 --- a/core/locales/locale.ru.conf +++ b/core/locales/locale.ru.conf @@ -37,6 +37,7 @@ Name = Название %File = Файл Untitled = Безымянный Switch Buffers = Переключение между буферами +theme not found. = CRLF = CRLF CR = CR LF = LF @@ -220,6 +221,7 @@ Toggle Virtual Space = Переключить режим _виртульных Zoom In = _Приблизить Zoom Out = _Отдалить Reset Zoom = _Сбросить масштаб +Select Theme... = Help = _Справка Show Manual = Показать _руководство Show LuaDoc = Показать документацию по _lua diff --git a/doc/manual/14_Appendix.md b/doc/manual/14_Appendix.md index 61cd8a0d..5ca4b9c6 100644 --- a/doc/manual/14_Appendix.md +++ b/doc/manual/14_Appendix.md @@ -132,6 +132,7 @@ Ctrl+Alt+Shift+V |^⇧V |Toggle virtual space Ctrl+= |⌘= |Zoom in Ctrl+- |⌘- |Zoom out Ctrl+0 |⌘0 |Reset zoom +Ctrl+Shift+T |⌘⇧T |Select theme... **Help** ||| F1 |F1 |Open manual diff --git a/doc/manual/8_Themes.md b/doc/manual/8_Themes.md index 64a1624d..81ee285d 100644 --- a/doc/manual/8_Themes.md +++ b/doc/manual/8_Themes.md @@ -1,16 +1,13 @@ # Themes Textadept's look and feel can be customized with themes. The themes that come -with Textadept are `'light'`, `'dark'`, and `'scite'`. By default the `'light'` -theme is used. The `'scite'` theme is recommended for users accustomed to SciTE. -To change the theme, create a `~/.textadept/theme` file whose first line of text -is the name of the theme you would like to use. +with Textadept are `light` and `dark`'. By default the `light` theme is used. To +change the theme, create a `~/.textadept/theme` file whose first line of text is +the name of the theme you would like to use.   - - Themes apply to all buffers. You cannot assign a theme to a particular file or filetype. You can change things like tab and indent settings per filetype @@ -55,14 +52,30 @@ See the [LuaDoc](../modules/buffer.html) for documentation on the properties. `view.lua` contains view-specific properties like caret and selection colors. See the [LuaDoc](../modules/buffer.html) for documentation on the properties. -## Theming Text Fields +## Testing Themes + +You can reload or switch between themes on the fly using `Ctrl+Shift+T` (⌘⇧T on +Mac OSX), but be aware that the Scintilla views do not reset themselves, so any +options set explicitly in the previous theme's `view.lua` file that are not set +explicitly in the new theme will carry over. The switch feature is intended +primarily for theme exploration and/or development and can be slow when many +buffers or views are open. + +Any errors that occur in the theme are printed to `io.stderr`. -There is no way to theme text fields like the Find and Replace ones from within -Textadept. Instead, use [GTK Resource files][gtkrc]. The names of the text field -widgets are: +## Theming the GUI -* Find field: `textadept-find-entry`. -* Replace field: `textadept-replace-entry`. -* Command entry: `textadept-command-entry`. +There is no way to theme GUI controls like text fields and buttons from within +Textadept. Instead, use [GTK Resource files][gtkrc]. The `GtkWindow` name is +`textadept`. For example, styling all text fields with a +`"textadept-entry-style"` would be done like this: + + widget "textadept*GtkEntry*" style "textadept-entry-style" [gtkrc]: http://library.gnome.org/devel/gtk/stable/gtk-Resource-Files.html + +## Getting Themes + +For now, user-created themes are obtained from the +[wiki](http://caladbolg.net/textadeptwiki). The classic `dark`, `light`, and +`scite` themes prior to version 4.3 have been moved there. diff --git a/doc/manual/images/scitetheme.png b/doc/manual/images/scitetheme.png Binary files differdeleted file mode 100644 index 6161006b..00000000 --- a/doc/manual/images/scitetheme.png +++ /dev/null diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua index 0b90c28a..fdf6b8b2 100644 --- a/modules/textadept/bookmarks.lua +++ b/modules/textadept/bookmarks.lua @@ -13,7 +13,7 @@ module('_m.textadept.bookmarks', package.seeall) -- `0xBBGGRR` format. -- settings -MARK_BOOKMARK_COLOR = 0xC08040 +MARK_BOOKMARK_COLOR = 0xB3661A -- end settings local MARK_BOOKMARK = _SCINTILLA.next_marker_number() diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua index 401a72e0..83dd1fd1 100644 --- a/modules/textadept/editing.lua +++ b/modules/textadept/editing.lua @@ -33,7 +33,7 @@ HIGHLIGHT_BRACES = true AUTOINDENT = true STRIP_WHITESPACE_ON_SAVE = true MARK_HIGHLIGHT_BACK = buffer and buffer.caret_line_back or 0xEEEEEE -INDIC_HIGHLIGHT_BACK = 0x4080C0 +INDIC_HIGHLIGHT_BACK = 0x4D99E6 INDIC_HIGHLIGHT_ALPHA = 100 -- end settings diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua index d3bdb1ec..77f269b0 100644 --- a/modules/textadept/keys.lua +++ b/modules/textadept/keys.lua @@ -101,7 +101,7 @@ if not RESETTING then constantize_menu_buffer_functions() end Windows and Linux menu key commands. Unassigned keys (~ denotes keys reserved by the operating system): - c: A B C H p qQ T ~ V X ) ] } * \n + c: A B C H p qQ ~ V X ) ] } * \n a: aAbBcCdDeEfFgGhHiIjJkKlLmMnNoOpP QrRsStTuUvVwWxXyYzZ_ ) ] } *+-/=~~\n\s ca: aAbBcCdDeE F jJkKlLmM N PqQ t xXy zZ_"'()[]{}<>* / ~~ \s @@ -116,7 +116,7 @@ if not RESETTING then constantize_menu_buffer_functions() end Mac OSX menu key commands. Unassigned keys (~ denotes keys reserved by the operating system): - m: A B C ~ JkK ~M p ~ tT U V Xy ) ] } * ~~\n~~ + m: A B C ~ JkK ~M p ~ t U V Xy ) ] } * ~~\n~~ c: cC D gG H J K L oO qQ xXyYzZ_ ) ] } * / \s cm: aAbBcC~DeE F ~HiIjJkKlL~MnN pPq~rRsStTuUvVwWxXyYzZ_"'()[]{}<>*+-/=\t\n~~ @@ -280,6 +280,7 @@ keys[not OSX and 'caV' or 'cV'] = keys[not OSX and 'c=' or 'm='] = _buffer.zoom_in keys[not OSX and 'c-' or 'm-'] = _buffer.zoom_out keys[not OSX and 'c0' or 'm0'] = utils.reset_zoom +keys[not OSX and 'cT' or 'mT'] = gui.select_theme -- Help. keys.f1 = { utils.open_webpage, _HOME..'/doc/manual/1_Introduction.html' } diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua index 6ef28b77..ddaf9aba 100644 --- a/modules/textadept/menu.lua +++ b/modules/textadept/menu.lua @@ -203,6 +203,8 @@ menubar = { { L('Zoom In'), _buffer.zoom_in }, { L('Zoom Out'), _buffer.zoom_out }, { L('Reset Zoom'), utils.reset_zoom }, + SEPARATOR, + { L('Select Theme...'), gui.select_theme }, }, { title = L('Help'), { L('Show Manual'), diff --git a/themes/dark/buffer.lua b/themes/dark/buffer.lua index 70d80751..70d80751 100755..100644 --- a/themes/dark/buffer.lua +++ b/themes/dark/buffer.lua diff --git a/themes/dark/lexer.lua b/themes/dark/lexer.lua index 04936944..3b2c7ce1 100644 --- a/themes/dark/lexer.lua +++ b/themes/dark/lexer.lua @@ -8,37 +8,73 @@ module('lexer', package.seeall) colors = { - green = color('4D', '99', '4D'), - blue = color('40', '80', 'C0'), - red = color('99', '4C', '4C'), - yellow = color('99', '99', '4D'), - teal = color('4D', '99', '99'), - white = color('AA', 'AA', 'AA'), - black = color('33', '33', '33'), - grey = color('99', '99', '99'), - purple = color('99', '4D', '99'), - orange = color('C0', '80', '40'), + -- Greyscale colors. +--dark_black = color('00', '00', '00'), + black = color('1A', '1A', '1A'), + light_black = color('33', '33', '33'), + -- color('4D', '4D', '4D'), + dark_grey = color('66', '66', '66'), +--grey = color('80', '80', '80'), + light_grey = color('99', '99', '99'), + -- color('B3', 'B3', 'B3'), + dark_white = color('CC', 'CC', 'CC'), +--white = color('E6', 'E6', 'E6'), +--light_white = color('FF', 'FF', 'FF'), + + -- Dark colors. +--dark_red = color('66', '1A', '1A'), +--dark_yellow = color('66', '66', '1A'), +--dark_green = color('1A', '66', '1A'), +--dark_teal = color('1A', '66', '66'), +--dark_purple = color('66', '1A', '66'), +--dark_orange = color('B3', '66', '1A'), +--dark_pink = color('B3', '66', '66'), +--dark_lavender = color('66', '66', 'B3'), +--dark_blue = color('1A', '66', 'B3'), + + -- Normal colors. + red = color('99', '4D', '4D'), + yellow = color('99', '99', '4D'), + green = color('4D', '99', '4D'), + teal = color('4D', '99', '99'), + purple = color('99', '4D', '99'), + orange = color('E6', '99', '4D'), +--pink = color('E6', '99', '99'), + lavender = color('99', '99', 'E6'), + blue = color('4D', '99', 'E6'), + + -- Light colors. + light_red = color('CC', '80', '80'), + light_yellow = color('CC', 'CC', '80'), + light_green = color('80', 'CC', '80'), +--light_teal = color('80', 'CC', 'CC'), +--light_purple = color('CC', '80', 'CC'), +--light_orange = color('FF', 'CC', '80'), +--light_pink = color('FF', 'CC', 'CC'), +--light_lavender = color('CC', 'CC', 'FF'), + light_blue = color('80', 'CC', 'FF'), } -style_nothing = style { } -style_char = style { fore = colors.red, bold = true } -style_class = style { fore = colors.white, underline = true } -style_comment = style { fore = colors.blue, bold = true } -style_constant = style { fore = colors.teal, bold = true } -style_definition = style { fore = colors.red, bold = true } -style_error = style { fore = colors.red, italic = true } -style_function = style { fore = colors.white, bold = true } -style_keyword = style { fore = colors.yellow, bold = true } -style_number = style { fore = colors.teal } -style_operator = style { fore = colors.white, bold = true } -style_string = style { fore = colors.green, bold = true } -style_preproc = style { fore = colors.blue } -style_tag = style { fore = colors.teal, bold = true } -style_type = style { fore = colors.green } -style_variable = style { fore = colors.white, italic = true } -style_whitespace = style { } -style_embedded = style_tag..{ back = color('44', '44', '44') } -style_identifier = style_nothing +style_nothing = style { } +style_class = style { fore = colors.light_yellow } +style_comment = style { fore = colors.dark_grey } +style_constant = style { fore = colors.red } +style_definition = style { fore = colors.light_yellow } +style_error = style { fore = colors.red, italic = true } +style_function = style { fore = colors.blue } +style_keyword = style { fore = colors.dark_white } +style_label = style { fore = colors.orange } +style_number = style { fore = colors.teal } +style_operator = style { fore = colors.yellow } +style_regex = style { fore = colors.light_green } +style_string = style { fore = colors.green } +style_preproc = style { fore = colors.purple } +style_tag = style { fore = colors.dark_white } +style_type = style { fore = colors.lavender } +style_variable = style { fore = colors.light_blue } +style_whitespace = style { } +style_embedded = style_tag..{ back = colors.light_black } +style_identifier = style_nothing -- Default styles. local font_face = '!Bitstream Vera Sans Mono' @@ -52,12 +88,12 @@ end style_default = style { font = font_face, size = font_size, - fore = colors.white, + fore = colors.light_grey, back = colors.black } -style_line_number = style { fore = colors.black, back = colors.grey } -style_bracelight = style { fore = color('66', '99', 'FF'), bold = true } -style_bracebad = style { fore = color('FF', '66', '99'), bold = true } +style_line_number = style { fore = colors.dark_grey, back = colors.black } +style_bracelight = style { fore = colors.light_blue } +style_bracebad = style { fore = colors.light_red } style_controlchar = style_nothing -style_indentguide = style { fore = colors.grey, back = colors.white } -style_calltip = style { fore = colors.white, back = color('44', '44', '44') } +style_indentguide = style { fore = colors.light_black, back = colors.light_black } +style_calltip = style { fore = colors.light_grey, back = colors.light_black } diff --git a/themes/dark/view.lua b/themes/dark/view.lua index 69a54953..95c1a5a2 100755..100644 --- a/themes/dark/view.lua +++ b/themes/dark/view.lua @@ -39,12 +39,12 @@ buffer:set_y_caret_policy(13, 1) -- CARET_SLOP | CARET_STRICT | CARET_EVEN -- Caret and Selection Styles. buffer:set_sel_fore(1, 0x333333) -buffer:set_sel_back(1, 0x999999) +buffer:set_sel_back(1, 0x808080) --buffer.sel_alpha = --buffer.sel_eol_filled = true -buffer.caret_fore = 0xAAAAAA +buffer.caret_fore = 0x808080 buffer.caret_line_visible = true -buffer.caret_line_back = 0x444444 +buffer.caret_line_back = 0x333333 --buffer.caret_line_back_alpha = --buffer.caret_period = 0 --buffer.caret_style = 2 @@ -64,8 +64,8 @@ buffer.margin_mask_n[2] = c.SC_MASK_FOLDERS buffer.margin_sensitive_n[2] = true --buffer.margin_left = --buffer.margin_right = -buffer:set_fold_margin_colour(1, 0xAAAAAA) -buffer:set_fold_margin_hi_colour(1, 0xAAAAAA) +buffer:set_fold_margin_colour(1, 0x1A1A1A) +buffer:set_fold_margin_hi_colour(1, 0x1A1A1A) -- Annotations. buffer.annotation_visible = 2 @@ -79,11 +79,11 @@ buffer.indentation_guides = 3 -- Fold Margin Markers. buffer:marker_define(c.SC_MARKNUM_FOLDEROPEN, c.SC_MARK_ARROWDOWN) -buffer:marker_set_fore(c.SC_MARKNUM_FOLDEROPEN, 0) -buffer:marker_set_back(c.SC_MARKNUM_FOLDEROPEN, 0) +buffer:marker_set_fore(c.SC_MARKNUM_FOLDEROPEN, 0x666666) +buffer:marker_set_back(c.SC_MARKNUM_FOLDEROPEN, 0x666666) buffer:marker_define(c.SC_MARKNUM_FOLDER, c.SC_MARK_ARROW) -buffer:marker_set_fore(c.SC_MARKNUM_FOLDER, 0) -buffer:marker_set_back(c.SC_MARKNUM_FOLDER, 0) +buffer:marker_set_fore(c.SC_MARKNUM_FOLDER, 0x666666) +buffer:marker_set_back(c.SC_MARKNUM_FOLDER, 0x666666) buffer:marker_define(c.SC_MARKNUM_FOLDERSUB, c.SC_MARK_EMPTY) buffer:marker_define(c.SC_MARKNUM_FOLDERTAIL, c.SC_MARK_EMPTY) buffer:marker_define(c.SC_MARKNUM_FOLDEREND, c.SC_MARK_EMPTY) @@ -113,7 +113,7 @@ buffer:set_fold_flags(16) -- Long Lines. --buffer.edge_mode = 1 --buffer.edge_column = 80 ---buffer.edge_colour = 0xAAAAAA +--buffer.edge_colour = 0x666666 -- Notifications. buffer.mod_event_mask = c.SC_MOD_CHANGEFOLD diff --git a/themes/light/buffer.lua b/themes/light/buffer.lua index 6d4a311a..6d4a311a 100755..100644 --- a/themes/light/buffer.lua +++ b/themes/light/buffer.lua diff --git a/themes/light/lexer.lua b/themes/light/lexer.lua index baa58e7a..7b9ea4fb 100644 --- a/themes/light/lexer.lua +++ b/themes/light/lexer.lua @@ -8,43 +8,72 @@ module('lexer', package.seeall) colors = { - green = color('4D', '99', '4D'), - blue = color('4D', '4D', '99'), - red = color('99', '4C', '4C'), - yellow = color('99', '99', '4D'), - teal = color('4D', '99', '99'), - white = color('EE', 'EE', 'EE'), - black = color('33', '33', '33'), - grey = color('AA', 'AA', 'AA'), - purple = color('99', '4D', '99'), - orange = color('C0', '80', '40'), - lgreen = color('80', 'C0', '40'), - lblue = color('40', '80', 'C0'), - lred = color('C0', '40', '40'), - lyellow = color('C0', 'C0', '40'), - lteal = color('40', 'C0', 'C0'), - lpurple = color('C0', '40', '80'), - lorange = color('C0', '80', '40'), + -- Greyscale colors. +--dark_black = color('00', '00', '00'), +--black = color('1A', '1A', '1A'), + light_black = color('33', '33', '33'), + -- color('4D', '4D', '4D'), +--dark_grey = color('66', '66', '66'), + grey = color('80', '80', '80'), +--light_grey = color('99', '99', '99'), + -- color('B3', 'B3', 'B3'), + dark_white = color('CC', 'CC', 'CC'), + white = color('E6', 'E6', 'E6'), +--light_white = color('FF', 'FF', 'FF'), + + -- Dark colors. +--dark_red = color('66', '1A', '1A'), + dark_yellow = color('66', '66', '1A'), + dark_green = color('1A', '66', '1A'), +--dark_teal = color('1A', '66', '66'), +--dark_purple = color('66', '1A', '66'), + dark_orange = color('B3', '66', '1A'), +--dark_pink = color('B3', '66', '66'), + dark_lavender = color('66', '66', 'B3'), + dark_blue = color('1A', '66', 'B3'), + + -- Normal colors. + red = color('99', '4D', '4D'), + yellow = color('99', '99', '4D'), + green = color('4D', '99', '4D'), + teal = color('4D', '99', '99'), + purple = color('99', '4D', '99'), +--orange = color('E6', '99', '4D'), +--pink = color('E6', '99', '99'), + lavender = color('99', '99', 'E6'), +--blue = color('4D', '99', 'E6'), + + -- Light colors. + light_red = color('CC', '80', '80'), +--light_yellow = color('CC', 'CC', '80'), +--light_green = color('80', 'CC', '80'), +--light_teal = color('80', 'CC', 'CC'), +--light_purple = color('CC', '80', 'CC'), +--light_orange = color('FF', 'CC', '80'), +--light_pink = color('FF', 'CC', 'CC'), +--light_lavender = color('CC', 'CC', 'FF'), + light_blue = color('80', 'CC', 'FF'), } -style_nothing = style { } -style_char = style { fore = colors.red, bold = true } -style_class = style { fore = colors.black, underline = true } -style_comment = style { fore = colors.lblue, bold = true } -style_constant = style { fore = colors.teal, bold = true } -style_definition = style { fore = colors.red, bold = true } -style_error = style { fore = colors.lred } -style_function = style { fore = colors.blue, bold = true } -style_keyword = style { fore = colors.yellow, bold = true } -style_number = style { fore = colors.teal } -style_operator = style { fore = colors.black, bold = true } -style_string = style { fore = colors.green, bold = true } -style_preproc = style { fore = colors.red } -style_tag = style { fore = colors.teal, bold = true } -style_type = style { fore = colors.green } -style_variable = style { fore = colors.red } -style_whitespace = style { } -style_embedded = style_tag..{ back = color('DD', 'DD', 'DD') } +style_nothing = style { } +style_class = style { fore = colors.yellow } +style_comment = style { fore = colors.grey } +style_constant = style { fore = colors.red } +style_definition = style { fore = colors.yellow } +style_error = style { fore = colors.red, italic = true } +style_function = style { fore = colors.dark_orange } +style_keyword = style { fore = colors.dark_blue } +style_label = style { fore = colors.dark_orange } +style_number = style { fore = colors.teal } +style_operator = style { fore = colors.purple } +style_regex = style { fore = colors.dark_green } +style_string = style { fore = colors.green } +style_preproc = style { fore = colors.dark_yellow } +style_tag = style { fore = colors.dark_blue } +style_type = style { fore = colors.lavender } +style_variable = style { fore = colors.dark_lavender } +style_whitespace = style { } +style_embedded = style_tag..{ back = colors.dark_white } style_identifier = style_nothing -- Default styles. @@ -59,12 +88,12 @@ end style_default = style { font = font_face, size = font_size, - fore = colors.black, + fore = colors.light_black, back = colors.white } -style_line_number = style { fore = colors.black, back = colors.grey } -style_bracelight = style { fore = color('66', '99', 'FF'), bold = true } -style_bracebad = style { fore = color('FF', '66', '99'), bold = true } +style_line_number = style { fore = colors.grey, back = colors.white } +style_bracelight = style { fore = colors.light_blue } +style_bracebad = style { fore = colors.light_red } style_controlchar = style_nothing -style_indentguide = style { fore = colors.grey, back = colors.white } -style_calltip = style { fore = colors.black, back = color('DD', 'DD', 'DD') } +style_indentguide = style { fore = colors.dark_white, back = colors.dark_white } +style_calltip = style { fore = colors.light_black, back = colors.dark_white } diff --git a/themes/light/view.lua b/themes/light/view.lua index a7ebac22..eee5d200 100755..100644 --- a/themes/light/view.lua +++ b/themes/light/view.lua @@ -42,9 +42,9 @@ buffer:set_sel_fore(1, 0x333333) buffer:set_sel_back(1, 0x999999) --buffer.sel_alpha = --buffer.sel_eol_filled = true -buffer.caret_fore = 0x333333 +buffer.caret_fore = 0x4D4D4D buffer.caret_line_visible = true -buffer.caret_line_back = 0xDDDDDD +buffer.caret_line_back = 0xCCCCCC --buffer.caret_line_back_alpha = --buffer.caret_period = 0 --buffer.caret_style = 2 @@ -64,8 +64,8 @@ buffer.margin_mask_n[2] = c.SC_MASK_FOLDERS buffer.margin_sensitive_n[2] = true --buffer.margin_left = --buffer.margin_right = -buffer:set_fold_margin_colour(1, 0xCCCCCC) -buffer:set_fold_margin_hi_colour(1, 0xCCCCCC) +buffer:set_fold_margin_colour(1, 0xE6E6E6) +buffer:set_fold_margin_hi_colour(1, 0xE6E6E6) -- Annotations. buffer.annotation_visible = 2 @@ -79,11 +79,11 @@ buffer.indentation_guides = 3 -- Fold Margin Markers. buffer:marker_define(c.SC_MARKNUM_FOLDEROPEN, c.SC_MARK_ARROWDOWN) -buffer:marker_set_fore(c.SC_MARKNUM_FOLDEROPEN, 0) -buffer:marker_set_back(c.SC_MARKNUM_FOLDEROPEN, 0) +buffer:marker_set_fore(c.SC_MARKNUM_FOLDEROPEN, 0x808080) +buffer:marker_set_back(c.SC_MARKNUM_FOLDEROPEN, 0x808080) buffer:marker_define(c.SC_MARKNUM_FOLDER, c.SC_MARK_ARROW) -buffer:marker_set_fore(c.SC_MARKNUM_FOLDER, 0) -buffer:marker_set_back(c.SC_MARKNUM_FOLDER, 0) +buffer:marker_set_fore(c.SC_MARKNUM_FOLDER, 0x808080) +buffer:marker_set_back(c.SC_MARKNUM_FOLDER, 0x808080) buffer:marker_define(c.SC_MARKNUM_FOLDERSUB, c.SC_MARK_EMPTY) buffer:marker_define(c.SC_MARKNUM_FOLDERTAIL, c.SC_MARK_EMPTY) buffer:marker_define(c.SC_MARKNUM_FOLDEREND, c.SC_MARK_EMPTY) @@ -113,7 +113,7 @@ buffer:set_fold_flags(16) -- Long Lines. --buffer.edge_mode = 1 --buffer.edge_column = 80 ---buffer.edge_colour = 0x333333 +--buffer.edge_colour = 0x808080 -- Notifications. buffer.mod_event_mask = c.SC_MOD_CHANGEFOLD diff --git a/themes/scite/buffer.lua b/themes/scite/buffer.lua deleted file mode 100755 index d6c5ba5d..00000000 --- a/themes/scite/buffer.lua +++ /dev/null @@ -1,16 +0,0 @@ --- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. --- SciTE editor theme for Textadept. - -local buffer = buffer - --- Folding. -buffer.property['fold'] = '1' -buffer.property['fold.by.indentation'] = '1' -buffer.property['fold.line.comments'] = '0' - --- Tabs and Indentation. -buffer.tab_width = 2 -buffer.use_tabs = false -buffer.indent = 2 -buffer.tab_indents = true -buffer.back_space_un_indents = true diff --git a/themes/scite/lexer.lua b/themes/scite/lexer.lua deleted file mode 100644 index 49546be1..00000000 --- a/themes/scite/lexer.lua +++ /dev/null @@ -1,63 +0,0 @@ --- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. --- SciTE lexer theme for Textadept. - --- Please note this theme is in a separate Lua state than Textadept's main one. --- This means the global variables like 'buffer', 'view', and 'gui' are not --- available here. Only the variables in the 'lexer' module are. - -module('lexer', package.seeall) - -colors = { - green = color('00', '7F', '00'), - blue = color('00', '00', '7F'), - red = color('7F', '00', '00'), - yellow = color('7F', '7F', '00'), - teal = color('00', '7F', '7F'), - white = color('FF', 'FF', 'FF'), - black = color('00', '00', '00'), - grey = color('80', '80', '80'), - purple = color('7F', '00', '7F'), - orange = color('B0', '7F', '00'), -} - -style_nothing = style { } -style_char = style { fore = colors.purple } -style_class = style { fore = colors.black, bold = true } -style_comment = style { fore = colors.green } -style_constant = style { fore = colors.teal, bold = true } -style_definition = style { fore = colors.black, bold = true } -style_error = style { fore = colors.red } -style_function = style { fore = colors.black, bold = true } -style_keyword = style { fore = colors.blue, bold = true } -style_number = style { fore = colors.teal } -style_operator = style { fore = colors.black, bold = true } -style_string = style { fore = colors.purple } -style_preproc = style { fore = colors.yellow } -style_tag = style { fore = colors.teal } -style_type = style { fore = colors.blue } -style_variable = style { fore = colors.black } -style_whitespace = style { } -style_identifier = style_nothing - --- Default styles. -local font_face = '!Monospace' -local font_size = 11 -if WIN32 then - font_face = '!Courier New' -elseif OSX then - font_face = '!Monaco' - font_size = 12 -end -style_default = style { - font = font_face, - size = font_size, - fore = colors.black, - back = colors.white, -} -style_line_number = style { back = color('C0', 'C0', 'C0') } -style_bracelight = style { fore = color('00', '00', 'FF'), bold = true } -style_bracebad = style { fore = color('FF', '00', '00'), bold = true } -style_controlchar = style_nothing -style_indentguide = style { fore = color('C0', 'C0', 'C0'), - back = colors.white } -style_calltip = style { fore = colors.white, back = color('44', '44', '44') } diff --git a/themes/scite/view.lua b/themes/scite/view.lua deleted file mode 100755 index 824ba219..00000000 --- a/themes/scite/view.lua +++ /dev/null @@ -1,119 +0,0 @@ --- Copyright 2007-2011 Mitchell mitchell<att>caladbolg.net. See LICENSE. --- SciTE editor theme for Textadept. - -local c = _SCINTILLA.constants -local buffer = buffer - --- Multiple Selection and Virtual Space -buffer.multiple_selection = true -buffer.additional_selection_typing = true ---buffer.multi_paste = 1 ---buffer.virtual_space_options = 3 -if not WIN32 and not OSX then buffer.rectangular_selection_modifier = 8 end ---buffer.additional_sel_alpha = ---buffer.additional_sel_fore = ---buffer.additional_sel_back = ---buffer.additional_caret_fore = ---buffer.additional_carets_blink = false ---buffer.additional_carets_visible = false - --- Scrolling. -buffer:set_x_caret_policy(1, 20) -- CARET_SLOP -buffer:set_y_caret_policy(13, 1) -- CARET_SLOP | CARET_STRICT | CARET_EVEN ---buffer:set_visible_policy() ---buffer.h_scroll_bar = false ---buffer.v_scroll_bar = false ---buffer.x_offset = ---buffer.scroll_width = ---buffer.scroll_width_tracking = true ---buffer.end_at_last_line = false - --- Whitespace ---buffer.view_ws = 1 ---buffer.whitespace_size = ---buffer.extra_ascent = ---buffer.extra_descent = - --- Line Endings ---buffer.view_eol = true - --- Caret and Selection Styles. ---buffer:set_sel_fore() ---buffer:set_sel_back() ---buffer.sel_alpha = ---buffer.sel_eol_filled = true ---buffer.caret_fore = ---buffer.caret_line_visible = true ---buffer.caret_line_back = ---buffer.caret_line_back_alpha = ---buffer.caret_period = 0 ---buffer.caret_style = 2 ---buffer.caret_width = ---buffer.caret_sticky = 1 - --- Line Number Margin. -buffer.margin_width_n[0] = 4 + 4 * buffer:text_width(c.STYLE_LINENUMBER, "9") - --- Marker Margin. ---buffer.margin_width_n[1] = 0 - --- Fold margin. -buffer.margin_type_n[2] = c.SC_MARGIN_SYMBOL -buffer.margin_width_n[2] = 16 -buffer.margin_mask_n[2] = c.SC_MASK_FOLDERS -buffer.margin_sensitive_n[2] = true ---buffer.margin_left = ---buffer.margin_right = ---buffer:set_fold_margin_colour() ---buffer:set_fold_margin_hi_colour() - --- Annotations. -buffer.annotation_visible = 2 - --- Other. ---buffer.buffered_draw = false ---buffer.two_phase_draw = false - --- Indentation Guides. -buffer.indentation_guides = 3 - --- Fold Margin Markers. -buffer:marker_define(c.SC_MARKNUM_FOLDEROPEN, c.SC_MARK_MINUS) -buffer:marker_set_fore(c.SC_MARKNUM_FOLDEROPEN, 16777215) -buffer:marker_set_back(c.SC_MARKNUM_FOLDEROPEN, 0) -buffer:marker_define(c.SC_MARKNUM_FOLDER, c.SC_MARK_PLUS) -buffer:marker_set_fore(c.SC_MARKNUM_FOLDER, 16777215) -buffer:marker_set_back(c.SC_MARKNUM_FOLDER, 0) -buffer:marker_define(c.SC_MARKNUM_FOLDERSUB, c.SC_MARK_EMPTY) -buffer:marker_define(c.SC_MARKNUM_FOLDERTAIL, c.SC_MARK_EMPTY) -buffer:marker_define(c.SC_MARKNUM_FOLDEREND, c.SC_MARK_EMPTY) -buffer:marker_define(c.SC_MARKNUM_FOLDEROPENMID, c.SC_MARK_EMPTY) -buffer:marker_define(c.SC_MARKNUM_FOLDERMIDTAIL, c.SC_MARK_EMPTY) - --- Autocompletion. ---buffer.auto_c_cancel_at_start = false -buffer.auto_c_choose_single = true ---buffer.auto_c_auto_hide = false ---buffer.auto_c_max_height = ---buffer.auto_c_max_width = - --- Call Tips. -buffer.call_tip_use_style = 0 - --- Folding. -buffer:set_fold_flags(16) - --- Line Wrapping. ---buffer.wrap_mode = 1 ---buffer.wrap_visual_flags = 1 ---buffer.wrap_visual_flags_location = 1 ---buffer.wrap_indent_mode = 1 ---buffer.wrap_start_indent = - --- Long Lines. ---buffer.edge_mode = 1 ---buffer.edge_column = 80 ---buffer.edge_colour = - --- Notifications. -buffer.mod_event_mask = c.SC_MOD_CHANGEFOLD |