aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar mitchell <70453897+667e-11@users.noreply.github.com>2013-05-15 17:00:50 -0400
committerGravatar mitchell <70453897+667e-11@users.noreply.github.com>2013-05-15 17:00:50 -0400
commitd042865f672d6708df80250c9c59172148a55f11 (patch)
treea9c38372853d202d843564ebff9c6eeee60b88fb
parente2767cd40f0994ea97cb91fb9e9ceef58b8f3342 (diff)
Rewrote theme implementation.
Themes are now just single files that share Textadept's Lua state. Also added a new "settings.lua" that functions in place of buffer and view theme files. Requires latest Scintillua.
-rw-r--r--core/gui.lua161
-rw-r--r--core/init.lua2
-rw-r--r--doc/04_WorkingWithFiles.md6
-rw-r--r--doc/06_AdeptEditing.md4
-rw-r--r--doc/08_Preferences.md78
-rw-r--r--doc/09_Themes.md66
-rw-r--r--modules/textadept/bookmarks.lua8
-rw-r--r--modules/textadept/editing.lua10
-rw-r--r--modules/textadept/keys.lua2
-rw-r--r--modules/textadept/menu.lua2
-rw-r--r--modules/textadept/run.lua8
-rw-r--r--settings.lua (renamed from themes/dark/view.lua)71
-rw-r--r--src/textadept.c7
-rw-r--r--themes/dark.lua118
-rw-r--r--themes/dark/buffer.lua16
-rw-r--r--themes/dark/lexer.lua100
-rw-r--r--themes/light.lua118
-rw-r--r--themes/light/buffer.lua16
-rw-r--r--themes/light/lexer.lua99
-rw-r--r--themes/light/view.lua124
-rw-r--r--themes/term.lua80
-rw-r--r--themes/term/buffer.lua16
-rw-r--r--themes/term/lexer.lua63
-rw-r--r--themes/term/view.lua122
24 files changed, 488 insertions, 809 deletions
diff --git a/core/gui.lua b/core/gui.lua
index 94aa4a82..3fd32c9b 100644
--- a/core/gui.lua
+++ b/core/gui.lua
@@ -157,108 +157,70 @@ function gui.goto_file(filename, split, preferred_view, sloppy)
io.open_file(filename)
end
-local theme_file = not CURSES and 'theme' or 'theme_term'
-local THEME
+local theme = _HOME..'/themes/'..(not CURSES and 'light' or 'term')..'.lua'
---
--- Sets the editor theme name to *name* or the default platform theme.
--- Themes with *name* in the *`_USERHOME`/themes/* directory override themes of
--- the same name in *`_HOME`/themes/*. If *name* contains slashes ('\' on
--- Windows, '/' otherwise), it is assumed to be an absolute path to a theme
--- instead of a theme name. An error is thrown if the theme is not found. Any
--- errors in the theme are printed to `io.stderr`. Running Textadept from a
--- terminal is the easiest way to see errors as they occur.
--- @param name Optional name or absolute path of a theme to set. If `nil`, sets
--- the default platform theme.
+-- Sets the editor theme name to *name* or prompts the user to select one from a
+-- list of themes found in the *`_USERHOME`/themes/* and *`_HOME`/themes/*
+-- directories.
+-- User themes override Textadept's default themes when they have the same name.
+-- If *name* contains slashes, it is assumed to be an absolute path to a theme
+-- instead of a theme name.
+-- @param name Optional name or absolute path of a theme to set. If `nil`, the
+-- user is prompted for one.
-- @name set_theme
function gui.set_theme(name)
if not name then
- -- Read theme from ~/.textadept/theme or ~/.textadept/theme_term depending
- -- on CURSES platform, defaulting to 'light' or 'term' respectively.
- local f = io.open(_USERHOME..'/'..theme_file, 'rb')
- if f then
- name = f:read('*line'):match('[^\r\n]+')
- f:close()
+ local themes, themes_found = {}, {}
+ for theme in lfs.dir(_HOME..'/themes') do
+ theme = theme:match('^(.-)%.lua$')
+ if theme then themes_found[theme] = true end
end
- if not name or name == '' then name = not CURSES and 'light' or 'term' 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
+ if lfs.attributes(_USERHOME..'/themes') then
+ for theme in lfs.dir(_USERHOME..'/themes/') do
+ theme = theme:match('^(.-)%.lua$')
+ if theme then themes_found[theme] = true end
+ end
end
- elseif lfs.attributes(name) then
- theme = name
+ for theme in pairs(themes_found) do themes[#themes + 1] = theme end
+ table.sort(themes)
+ name = gui.filteredlist(_L['Select Theme'], _L['Name'], themes)
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)
+ if name and not name:find('[/\\]') then
+ name = package.searchpath(name, _USERHOME..'/themes/?.lua;'..
+ _HOME..'/themes/?.lua')
end
- THEME = theme
-end
-
----
--- Prompts the user to select an editor theme from a list of themes found in the
--- *`_HOME`/themes/* and *`_USERHOME`/themes/* directories.
--- @name select_theme
-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
+ if not name or not lfs.attributes(name) then return end
+ local current_buffer, current_view = _BUFFERS[buffer], _VIEWS[view]
+ for i = 1, #_BUFFERS do
+ view:goto_buffer(i)
+ dofile(name)
end
- if lfs.attributes(_USERHOME..'/themes') then
- local theme_dir = _USERHOME..'/themes/'
- for theme in lfs.dir(theme_dir) do
- if not theme:find('^%.') and
- lfs.attributes(theme_dir..theme, 'mode') == 'directory' then
- themes_found[theme] = true
- end
- end
+ view:goto_buffer(current_buffer)
+ for i = 1, #_VIEWS do
+ gui.goto_view(i)
+ dofile(name)
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 not theme then return end
- gui.set_theme(theme)
- -- Write the theme to the user's theme file.
- local f = io.open(_USERHOME..'/'..theme_file, 'wb')
- if not f then return end
- f:write(theme)
- f:close()
- reset()
+ gui.goto_view(current_view)
+-- if not RESETTING then reset() end
+ theme = name
end
local events, events_connect = events, events.connect
+-- Loads the theme and settings files.
+local function load_theme_and_settings()
+ dofile(theme)
+ dofile(_HOME..'/settings.lua')
+ if lfs.attributes(_USERHOME..'/settings.lua') then
+ dofile(_USERHOME..'/settings.lua')
+ end
+end
+
-- Sets default properties for a Scintilla window.
events_connect(events.VIEW_NEW, function()
local buffer = buffer
local c = _SCINTILLA.constants
-
-- Allow redefinitions of these Scintilla key commands.
local ctrl_keys = {
'[', ']', '/', '\\', 'Z', 'Y', 'X', 'C', 'V', 'A', 'L', 'T', 'D', 'U'
@@ -270,42 +232,23 @@ events_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
- -- Load theme.
- local ok, err = pcall(dofile, THEME..'/view.lua')
- if not ok then io.stderr:write(err) end
+ load_theme_and_settings()
end)
events_connect(events.VIEW_NEW, function() events.emit(events.UPDATE_UI) end)
local SETDIRECTFUNCTION = _SCINTILLA.properties.direct_function[1]
local SETDIRECTPOINTER = _SCINTILLA.properties.doc_pointer[2]
local SETLEXERLANGUAGE = _SCINTILLA.properties.lexer_language[2]
-local function set_properties()
- local buffer = buffer
- -- Lexer.
+-- Sets default properties for a Scintilla document.
+events_connect(events.BUFFER_NEW, function()
+ buffer.code_page = _SCINTILLA.constants.SC_CP_UTF8
+ buffer.style_bits = 8
buffer.lexer_language = 'lpeg'
buffer:private_lexer_call(SETDIRECTFUNCTION, buffer.direct_function)
buffer:private_lexer_call(SETDIRECTPOINTER, buffer.direct_pointer)
- buffer:private_lexer_call(SETLEXERLANGUAGE, 'text')
- buffer.style_bits = 8
- -- Properties.
- buffer.property['textadept.home'] = _HOME
buffer.property['lexer.lpeg.home'] = _LEXERPATH
- buffer.property['lexer.lpeg.color.theme'] = THEME..'/lexer.lua'
- -- Buffer.
- buffer.code_page = _SCINTILLA.constants.SC_CP_UTF8
- -- Load theme.
- 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.
-events_connect(events.BUFFER_NEW, function()
- -- Normally when an error occurs, a new buffer is created with the error
- -- message, but if an error occurs here, this event would be called again and
- -- again, erroring each time resulting in an infinite loop; print error to
- -- stderr instead.
- local ok, err = pcall(set_properties)
- if not ok then io.stderr:write(err) end
+ load_theme_and_settings()
+ buffer:private_lexer_call(SETLEXERLANGUAGE, 'text')
end)
-- Sets the title of the Textadept window to the buffer's filename.
diff --git a/core/init.lua b/core/init.lua
index c58bc68e..90505dec 100644
--- a/core/init.lua
+++ b/core/init.lua
@@ -18,8 +18,6 @@ _M = {} -- modules table
-- LuaJIT compatibility.
if jit then module, package.searchers, bit32 = nil, package.loaders, bit end
-gui.set_theme()
-
--[[ This comment is for LuaDoc.
---
-- Extends Lua's _G table to provide extra functions and fields for Textadept.
diff --git a/doc/04_WorkingWithFiles.md b/doc/04_WorkingWithFiles.md
index 373b7851..ff8ce0fa 100644
--- a/doc/04_WorkingWithFiles.md
+++ b/doc/04_WorkingWithFiles.md
@@ -36,8 +36,8 @@ settings in the buffer status statusbar.
#### Indentation
-Indentation is usually set by a [language-specific module][] or the current
-[theme][]. By default, indentation is 2 spaces. You can toggle between using
+Indentation is usually set by a [language-specific module][] or by the user's
+[settings][]. By default, indentation is 2 spaces. You can toggle between using
tabs and spaces manually by pressing `Ctrl+Alt+Shift+T` (`^⇧T` on Mac OSX |
`M-T` or `M-S-T` in curses). Toggling between tabs and spaces only affects
future indentation; it does not convert existing indentation. `Ctrl+Alt+I` (`^I`
@@ -47,7 +47,7 @@ are converted to spaces.) Similarly, you can set indentation size manually using
the "Buffer -> Indentation" menu.
[language-specific module]: 07_Modules.html#Buffer.Properties
-[theme]: 09_Themes.html#Buffer
+[settings]: 08_Preferences.html#Buffer.Settings
#### Line Endings
diff --git a/doc/06_AdeptEditing.md b/doc/06_AdeptEditing.md
index 5cfd231e..86a3901e 100644
--- a/doc/06_AdeptEditing.md
+++ b/doc/06_AdeptEditing.md
@@ -74,7 +74,7 @@ and dragging the mouse to create rectangular selections.
Note: In some Linux environments, the `Alt+Shift+Arrow` combinations are used by
the window manager and may need to be reconfigured. Also, `Super+Mouse` is used
because `Alt+Mouse` generally moves windows. If you prefer to use "Alt", you can
-change [`buffer.rectangular_selection_modifier`][] in your [theme][]. The
+change [`buffer.rectangular_selection_modifier`][] in your [settings][]. The
"Super" modifier key is usually defined as the left "Windows" key, but may need
to be reconfigured too.
@@ -82,7 +82,7 @@ Creating rectangular selections with the mouse is currently unavailable in
curses.
[`buffer.rectangular_selection_modifier`]: api/buffer.html#rectangular_selection_modifier
-[theme]: 09_Themes.html#View
+[settings]: 08_Preferences.html#Buffer.Settings
### Select to Matching Brace
diff --git a/doc/08_Preferences.md b/doc/08_Preferences.md
index a3cbe3d8..d1acabc5 100644
--- a/doc/08_Preferences.md
+++ b/doc/08_Preferences.md
@@ -10,39 +10,38 @@ At this point it is assumed you are at least familiar with the basics of
Textadept executes a *~/.textadept/init.lua*, your user-init file, on startup.
If this file does not exist, Textadept creates it for you. You can use the file
to indicate what you want Textadept to do when the application starts, such as
-loading additional modules. However, you are not restricted to just loading
-modules. You can run any Lua code you desire.
+changing the settings of existing modules, loading new ones, and/or running
+plain Lua code.
-## Modules
+### Modules
It is never recommended to modify the default modules that come with Textadept,
even if you just want to change an option in a generic module, modify the buffer
settings for a language-specific module, edit file types, or add a small bit of
custom code. Those changes may be overwritten when you upgrade Textadept to a
newer version. Instead you have two options: load your own module instead of the
-default one, or run your custom module code after the default module loads. To
-load your own module, simply place it appropriately in *~/.textadept/modules/*.
-To run your module code after a default generic module loads, put your code in
-*~/.textadept/init.lua*. To run your module code after a default
-language-specific module loads, create a *post_init.lua* Lua script in the
-appropriate *~/.textadept/modules/* module folder. These methods are discussed
-below.
+default one, or run your custom module code after the default module loads. For
+the most part you will want to use the second option because it is simpler and
+more compatible with future releases. Both options are discussed below in the
+context of generic and language-specific modules.
-### Generic
+#### Generic
Many of Textadept's generic modules have settings you can change from
*~/.textadept/init.lua* after the module is loaded. These settings are viewed
from module's [LuaDoc][]. For example, to disable character autopairing with
-typeover and stripping whitespace on save, your *~/.textadept/init.lua* might
-look like:
+typeover and stripping whitespace on save, your *~/.textadept/init.lua* would
+contain:
_M.textadept.editing.AUTOPAIR = false
_M.textadept.editing.TYPEOVER_CHARS = false
_M.textadept.editing.STRIP_WHITESPACE_ON_SAVE = false
Now suppose you wanted to load all of Textadept's default modules except for the
-menu. Copy the `textadept` module's *init.lua* (located in the
-*modules/textadept/* directory) to *~/.textadept/modules/textadept/* and change
+menu. You cannot do this after-the-fact from *~/.textadept/init.lua*. Instead
+you need Textadept to load your own module rather than the default one. Copy the
+`textadept` module's *init.lua* (located in the *modules/textadept/* directory)
+to *~/.textadept/modules/textadept/* and change
M.menu = require 'textadept.menu'
@@ -51,27 +50,27 @@ to
--M.menu = require 'textadept.menu'
Now when Textadept looks for *modules/textadept/init.lua*, it will load yours
-instead of its own, and load everything but the menu. If instead you wanted to
+in place of its own, and load everything but the menu. If instead you wanted to
completely change the menu structure, you would first create a new *menu.lua*
and then put it in *~/.textadept/modules/textadept/*. Textadept will now load
-your *menu.lua* instead of its own.
+your *menu.lua* rather than its own.
[LuaDoc]: api/index.html
-### Language-Specific
+#### Language-Specific
Similar to generic modules, putting your own language-specific module in
*~/.textadept/modules/* causes Textadept to load that module for editing the
language's code instead of the default one in *modules/* (if the latter exists).
For example, copying the default Lua language-specific module from
*modules/lua/* to *~/.textadept/modules/* causes Textadept to use that module
-for editing Lua code instead of the default one. If you make custom changes to
-these kinds of copies of language-specific modules, you will likely want to
-update them with each new Textadept release. Instead of potentially wasting time
-merging your changes, you can run custom code independent of a module in the
-module's *post_init.lua* file. For example, instead of copying the `lua` module
-and creating an `events.LANGUAGE_MODULE_LOADED` event handler to use tabs, you
-can do this from *~/.textadept/modules/lua/post_init.lua*:
+for editing Lua code in place of the default one. However, if you make custom
+changes to that module and upgrade Textadept later, the module may no longer be
+compatible. Rather than potentially wasting time merging changes, you can run
+custom code independent of a module in the module's *post_init.lua* file. For
+example, instead of copying the `lua` module and creating an
+`events.LANGUAGE_MODULE_LOADED` event handler to use tabs, you can do this from
+*~/.textadept/modules/lua/post_init.lua*:
events.connect(events.LANGUAGE_MODULE_LOADED, function(lang)
if lang == 'lua' then buffer.use_tabs = true end
@@ -133,6 +132,35 @@ You can learn about snippet syntax in the [snippets LuaDoc][].
[snippets LuaDoc]: api/_M.textadept.snippets.html
+## Buffer Settings
+
+Since *~/.textadept/init.lua* is only run once on startup, it is not the
+appropriate place to set per-buffer properties like indentation size or
+view-related properties like the behaviors for scrolling and autocompletion.
+If you do set such properties in *~/.textadept/init.lua*, those settings only
+apply to the first buffer and view -- subsequent buffers and split views will
+not inherit those settings. Instead, put your settings in a
+*~/.textadept/settings.lua* file which is run each time a new buffer or split
+view is created. Any settings there override Textadept's default *settings.lua*
+settings. For example, to use tabs rather than spaces and have a tab size of 4
+spaces by default your *~/.textadept/settings.lua* would contain:
+
+ buffer.tab_width = 4
+ buffer.use_tabs = true
+
+(Remember that in order to have per-filetype properties, you need to have a
+[language-specific module][].)
+
+You can use Textadept's *settings.lua* as a reference to see what properties are
+available. It also has many commented out properties that you can copy to your
+*~/.textadept/settings.lua* and uncomment to turn on or change the value of. You
+can use [Adeptsense][] to view a property's documentation or read the
+[LuaDoc][].
+
+[language-specific module]: 07_Modules.html#Buffer.Properties
+[Adeptsense]: 06_AdeptEditing.html#Adeptsense
+[LuaDoc]: api/buffer.html
+
## Locale
Textadept attempts to auto-detect your locale settings using the "$LANG"
diff --git a/doc/09_Themes.md b/doc/09_Themes.md
index 3c1de645..73f4c612 100644
--- a/doc/09_Themes.md
+++ b/doc/09_Themes.md
@@ -12,21 +12,17 @@ for the GUI version and "term" for the terminal version.
&nbsp;&nbsp;
![Term Theme](images/termtheme.png)
-## Structure
-
-Each theme is a single folder composed of three files: *lexer.lua*,
-*buffer.lua*, and *view.lua*. It is recommended to put custom or downloaded
+Each theme is a single Lua file. It is recommended to put custom or downloaded
themes in your *~/.textadept/themes/* directory so they will not be overwritten
when you update Textadept. Also, themes in that directory override any themes in
Textadept's *themes/* directory. This means that if you have your own *light*
theme, it will be loaded instead of the one that comes with Textadept.
-### Lexer
-
-*lexer.lua* contains definitions for how to "style" syntactic elements like
-comments, strings, and keywords in programming languages. [Styles][] are
-composed of fonts and colors and apply universally to all programming language
-elements, resulting in a single, unified theme.
+Themes contain color definitions and definitions for how to highlight (or
+"style") syntactic elements like comments, strings, and keywords in programming
+languages. These [definitions][] apply universally to all programming language
+elements, resulting in a single, unified theme. Themes also set view-related
+editor properties like caret and selection colors.
In the terminal version of Textadept, colors are determined by your terminal
emulator's settings. The only colors recognized by Textadept are the standard
@@ -35,54 +31,18 @@ those colors. How your terminal chooses to display these colors is up to your
terminal settings. However, you can still customize which colors are used for
particular styles.
-[Styles]: api/lexer.html#Styles.and.Styling
-
-### Buffer
-
-*buffer.lua* contains [buffer-specific properties][] like the indentation
-character and indentation size. For example, to use tabs instead of spaces and
-have a tab size of 4 spaces by default:
-
- buffer.tab_width = 4
- buffer.use_tabs = true
-
-You can use [Adeptsense][] to view a property's documentation or read the
-[buffer LuaDoc][].
+[definitions]: api/lexer.html#Styles.and.Styling
-[buffer-specific properties]: 04_WorkingWithFiles.html#Settings
-[Adeptsense]: 06_AdeptEditing.html#Adeptsense
-[buffer LuaDoc]: api/buffer.html
+## Switch Themes
-### View
+You can switch between or reload themes using `Ctrl+Shift+T` (`⌘⇧T` on Mac OSX |
+none in curses). You can set that theme to be the default one by putting
-*view.lua* contains view-specific properties which apply to all buffers. These
-properties are numerous and control many aspects of how buffers are displayed,
-from caret and selection colors to margin configurations to marker definitions.
-View properties also control editor behaviors like scrolling and autocompletion.
-Existing themes have various properties commented out. Uncomment a property to
-turn it on or change its value. You can use [Adeptsense][] to view a property's
-documentation or read the [LuaDoc][].
+ gui.set_theme('name')
-[Adeptsense]: 06_AdeptEditing.html#Adeptsense
-[LuaDoc]: api/buffer.html
+somewhere in your [*~/.textadept/init.lua*][].
-## Switch Themes
-
-You can switch between or reload themes using `Ctrl+Shift+T` (`⌘⇧T` on Mac OSX |
-none in curses). However, be aware that the views do not reset themselves. Any
-properties set explicitly in the previous theme's *view.lua* file that are not
-set explicitly in the new theme will carry over. Restarting Textadept will fix
-this. Also, be aware that themes apply to all buffers. You cannot assign a theme
-to a particular file or file type. (You can change things like tab and indent
-settings per filetype, however, by creating a [language-specific module][].)
-Behind the scenes, Textadept is setting the theme name in a *~/.textadept/theme*
-or *~/.textadept/theme_term* file. To use a theme not listed, specify an
-absolute path to the theme's folder in your *~/.textadept/theme* or
-*~/.textadept/theme_term* file. When testing themes, any errors that occur are
-printed to standard error. Running Textadept from a terminal is the easiest way
-to see errors as they occur.
-
-[language-specific module]: 07_Modules.html#Buffer.Properties
+[*~/.textadept/init.lua*]: 08_Preferences.html#User.Init
## GUI Theme
diff --git a/modules/textadept/bookmarks.lua b/modules/textadept/bookmarks.lua
index 3f383a56..d04bb424 100644
--- a/modules/textadept/bookmarks.lua
+++ b/modules/textadept/bookmarks.lua
@@ -5,11 +5,11 @@ local M = {}
--[[ This comment is for LuaDoc.
---
-- Bookmarks for Textadept.
--- @field MARK_BOOKMARK_COLOR (number)
--- The color, in "0xBBGGRR" format, used for a bookmarked line.
+-- @field BOOKMARK_COLOR (string)
+-- The name of the color in the current theme to mark a bookmarked line with.
module('_M.textadept.bookmarks')]]
-M.MARK_BOOKMARK_COLOR = not CURSES and 0xB3661A or 0xFF0000
+M.BOOKMARK_COLOR = not CURSES and 'color.dark_blue' or 'color.blue'
local MARK_BOOKMARK = _SCINTILLA.next_marker_number()
@@ -84,7 +84,7 @@ local CURSES_MARK = _SCINTILLA.constants.SC_MARK_CHARACTER + string.byte(' ')
-- Sets view properties for bookmark markers.
local function set_bookmark_properties()
if CURSES then buffer:marker_define(MARK_BOOKMARK, CURSES_MARK) end
- buffer.marker_back[MARK_BOOKMARK] = M.MARK_BOOKMARK_COLOR
+ buffer.marker_back[MARK_BOOKMARK] = buffer.property_int[M.BOOKMARK_COLOR]
end
if buffer then set_bookmark_properties() end
events.connect(events.VIEW_NEW, set_bookmark_properties)
diff --git a/modules/textadept/editing.lua b/modules/textadept/editing.lua
index 3fd8cb5b..aefb2eb4 100644
--- a/modules/textadept/editing.lua
+++ b/modules/textadept/editing.lua
@@ -27,9 +27,9 @@ local M = {}
-- @field STRIP_WHITESPACE_ON_SAVE (bool)
-- Strip trailing whitespace on file save.
-- The default value is `true`.
--- @field INDIC_HIGHLIGHT_BACK (number)
--- The color, in "0xBBGGRR" format, used for an indicator for the
--- [highlighted word](#highlight_word).
+-- @field HIGHLIGHT_COLOR (string)
+-- The name of the color in the current theme to
+-- [highlight words](#highlight_word) with.
module('_M.textadept.editing')]]
M.AUTOPAIR = true
@@ -37,7 +37,7 @@ M.HIGHLIGHT_BRACES = true
M.TYPEOVER_CHARS = true
M.AUTOINDENT = true
M.STRIP_WHITESPACE_ON_SAVE = true
-M.INDIC_HIGHLIGHT_BACK = not CURSES and 0x4D99E6 or 0x00FFFF
+M.HIGHLIGHT_COLOR = not CURSES and 'color.orange' or 'color.yellow'
---
-- Map of lexer names to line comment prefix strings for programming languages,
@@ -499,7 +499,7 @@ end
-- Sets view properties for highlighted word indicators and markers.
local function set_highlight_properties()
- buffer.indic_fore[INDIC_HIGHLIGHT] = M.INDIC_HIGHLIGHT_BACK
+ buffer.indic_fore[INDIC_HIGHLIGHT] = buffer.property_int[M.HIGHLIGHT_COLOR]
buffer.indic_style[INDIC_HIGHLIGHT] = _SCINTILLA.constants.INDIC_ROUNDBOX
buffer.indic_alpha[INDIC_HIGHLIGHT] = 255
if not CURSES then buffer.indic_under[INDIC_HIGHLIGHT] = true end
diff --git a/modules/textadept/keys.lua b/modules/textadept/keys.lua
index 2c2f1b43..3470e499 100644
--- a/modules/textadept/keys.lua
+++ b/modules/textadept/keys.lua
@@ -548,7 +548,7 @@ end
keys[not OSX and not CURSES and 'c=' or 'm='] = buffer.zoom_in
keys[not OSX and not CURSES and 'c-' or 'm-'] = buffer.zoom_out
keys[not OSX and not CURSES and 'c0' or 'm0'] = utils.reset_zoom
-if not CURSES then keys[not OSX and 'cT' or 'mT'] = gui.select_theme end
+if not CURSES then keys[not OSX and 'cT' or 'mT'] = gui.set_theme end
-- Help.
if not CURSES then
diff --git a/modules/textadept/menu.lua b/modules/textadept/menu.lua
index 7f945a9e..3ee4b6ee 100644
--- a/modules/textadept/menu.lua
+++ b/modules/textadept/menu.lua
@@ -185,7 +185,7 @@ local menubar = {
{_L['Zoom _Out'], buffer.zoom_out},
{_L['_Reset Zoom'], utils.reset_zoom},
SEPARATOR,
- {_L['Select _Theme...'], gui.select_theme},
+ {_L['Select _Theme...'], gui.set_theme},
},
{ title = _L['_Help'],
{_L['Show _Manual'],
diff --git a/modules/textadept/run.lua b/modules/textadept/run.lua
index 18577448..512d9ea9 100644
--- a/modules/textadept/run.lua
+++ b/modules/textadept/run.lua
@@ -10,8 +10,8 @@ local M = {}
-- extension.
--
-- [language-specific modules]: _M.html#Compile.and.Run
--- @field MARK_ERROR_BACK (number)
--- The background color, in "0xBBGGRR" format, used for a line containing a
+-- @field ERROR_COLOR (string)
+-- The name of the color in the current theme to mark a line containing a
-- recognized run or compile error.
-- @field cwd (string, Read-only)
-- The working directory for the most recently executed compile or run
@@ -35,7 +35,7 @@ local M = {}
-- * `output`: The string output from the command.
module('_M.textadept.run')]]
-M.MARK_ERROR_BACK = not CURSES and 0x8080CC or 0x0000FF
+M.ERROR_COLOR = not CURSES and 'color.light_red' or 'color.red'
-- Events.
events.COMPILE_OUTPUT, events.RUN_OUTPUT = 'compile_output', 'run_output'
@@ -246,7 +246,7 @@ local CURSES_MARK = _SCINTILLA.constants.SC_MARK_CHARACTER + string.byte(' ')
-- Sets view properties for error markers.
local function set_error_properties()
if CURSES then buffer:marker_define(MARK_ERROR, CURSES_MARK) end
- buffer.marker_back[MARK_ERROR] = M.MARK_ERROR_BACK
+ buffer.marker_back[MARK_ERROR] = buffer.property_int[M.ERROR_COLOR]
end
if buffer then set_error_properties() end
events.connect(events.VIEW_NEW, set_error_properties)
diff --git a/themes/dark/view.lua b/settings.lua
index 76170b12..5bce633e 100644
--- a/themes/dark/view.lua
+++ b/settings.lua
@@ -1,8 +1,7 @@
-- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
--- Dark editor theme for Textadept.
-local c = _SCINTILLA.constants
local buffer = buffer
+local c = _SCINTILLA.constants
-- Multiple Selection and Virtual Space
buffer.multiple_selection = true
@@ -12,10 +11,6 @@ buffer.additional_selection_typing = true
-- c.SCVS_USERACCESSIBLE
buffer.rectangular_selection_modifier = (WIN32 or OSX) and c.SCMOD_ALT or
c.SCMOD_SUPER
---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
@@ -40,58 +35,54 @@ buffer:set_y_caret_policy(13, 1) -- CARET_SLOP | CARET_STRICT | CARET_EVEN
--buffer.view_eol = true
-- Caret and Selection Styles.
-buffer:set_sel_fore(true, 0x333333)
-buffer:set_sel_back(true, 0x808080)
---buffer.sel_alpha =
--buffer.sel_eol_filled = true
-buffer.caret_fore = 0x808080
-buffer.caret_line_visible = true
+buffer.caret_line_visible = not CURSES
--buffer.caret_line_visible_always = true
-buffer.caret_line_back = 0x333333
---buffer.caret_line_back_alpha =
--buffer.caret_period = 0
--buffer.caret_style = c.CARETSTYLE_BLOCK
--buffer.caret_width =
--buffer.caret_sticky = c.SC_CARETSTICKY_ON
-- Line Number Margin.
-buffer.margin_width_n[0] = 4 + 4 * buffer:text_width(c.STYLE_LINENUMBER, '9')
+local width = 4 * buffer:text_width(c.STYLE_LINENUMBER, '9')
+buffer.margin_width_n[0] = width + (not CURSES and 4 or 0)
-- Marker Margin.
-buffer.margin_width_n[1] = 0 -- marker margin invisible
+buffer.margin_width_n[1] = not CURSES and 0 or 1
-- Fold Margin.
-buffer.margin_type_n[2] = c.SC_MARGIN_SYMBOL
-buffer.margin_width_n[2] = 10
+buffer.margin_width_n[2] = not CURSES and 10 or 1
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(true, 0x1A1A1A)
-buffer:set_fold_margin_hi_colour(true, 0x1A1A1A)
-- Annotations.
buffer.annotation_visible = c.ANNOTATION_BOXED
-- Other.
-buffer.buffered_draw = not OSX -- Quartz buffers drawing
+buffer.buffered_draw = not CURSES and not OSX -- Quartz buffers drawing on OSX
--buffer.two_phase_draw = false
--- Indentation Guides.
+-- Tabs and Indentation Guides.
+-- Note: tab and indentation settings apply to individual buffers.
+buffer.tab_width = 2
+buffer.use_tabs = false
+--buffer.indent = 2
+buffer.tab_indents = true
+buffer.back_space_un_indents = true
buffer.indentation_guides = c.SC_IV_LOOKBOTH
-- Fold Margin Markers.
-buffer:marker_define(c.SC_MARKNUM_FOLDEROPEN, c.SC_MARK_ARROWDOWN)
-buffer.marker_fore[c.SC_MARKNUM_FOLDEROPEN] = 0x666666
-buffer.marker_back[c.SC_MARKNUM_FOLDEROPEN] = 0x666666
-buffer:marker_define(c.SC_MARKNUM_FOLDER, c.SC_MARK_ARROW)
-buffer.marker_fore[c.SC_MARKNUM_FOLDER] = 0x666666
-buffer.marker_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)
-buffer:marker_define(c.SC_MARKNUM_FOLDEROPENMID, c.SC_MARK_EMPTY)
-buffer:marker_define(c.SC_MARKNUM_FOLDERMIDTAIL, c.SC_MARK_EMPTY)
+if not CURSES then
+ buffer:marker_define(c.SC_MARKNUM_FOLDEROPEN, c.SC_MARK_ARROWDOWN)
+ buffer:marker_define(c.SC_MARKNUM_FOLDER, c.SC_MARK_ARROW)
+ 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)
+end
-- Autocompletion.
--buffer.auto_c_cancel_at_start = false
@@ -101,12 +92,14 @@ buffer.auto_c_choose_single = true
--buffer.auto_c_max_width =
-- Call Tips.
---buffer.call_tip_use_style =
+buffer.call_tip_use_style = buffer.tab_width *
+ buffer:text_width(c.STYLE_CALLTIP, ' ')
-- Folding.
-buffer.fold_flags = c.SC_FOLDFLAG_LINEAFTER_CONTRACTED
-buffer.automatic_fold = c.SC_AUTOMATICFOLD_SHOW + c.SC_AUTOMATICFOLD_CLICK +
- c.SC_AUTOMATICFOLD_CHANGE
+buffer.property['fold'] = '1'
+buffer.property['fold.by.indentation'] = '1'
+buffer.property['fold.line.comments'] = '0'
+buffer.fold_flags = not CURSES and c.SC_FOLDFLAG_LINEAFTER_CONTRACTED or 0
-- Line Wrapping.
--buffer.wrap_mode = c.SC_WRAP_WORD
@@ -116,9 +109,5 @@ buffer.automatic_fold = c.SC_AUTOMATICFOLD_SHOW + c.SC_AUTOMATICFOLD_CLICK +
--buffer.wrap_start_indent =
-- Long Lines.
---buffer.edge_mode = c.EDGE_LINE
+--buffer.edge_mode = not CURSES and c.EDGE_LINE or c.EDGE_BACKGROUND
--buffer.edge_column = 80
---buffer.edge_colour = 0x666666
-
--- Notifications.
-buffer.mod_event_mask = c.SC_MOD_CHANGEFOLD
diff --git a/src/textadept.c b/src/textadept.c
index 9fe52c1d..8d8b1034 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -1877,9 +1877,10 @@ static void split_view(Scintilla *view, int vertical) {
gtk_widget_get_allocation(view, &allocation);
int middle = (vertical ? allocation.width : allocation.height) / 2;
- g_object_ref(view);
- GtkWidget *view2 = new_view(curdoc);
GtkWidget *parent = gtk_widget_get_parent(view);
+ if (!parent) return; // error on startup (e.g. loading theme or settings)
+ GtkWidget *view2 = new_view(curdoc);
+ g_object_ref(view);
gtk_container_remove(GTK_CONTAINER(parent), view);
GtkWidget *pane = vertical ? gtk_hpaned_new() : gtk_vpaned_new();
gtk_paned_add1(GTK_PANED(pane), view), gtk_paned_add2(GTK_PANED(pane), view2);
@@ -1988,12 +1989,12 @@ static Scintilla *new_view(sptr_t doc) {
#endif
SS(view, SCI_USEPOPUP, 0, 0);
lL_addview(lua, view);
+ l_setglobalview(lua, view);
focused_view = view, focus_view(view);
if (doc) {
SS(view, SCI_SETDOCPOINTER, 0, doc);
l_setglobaldoc(lua, doc);
} else new_buffer(SS(view, SCI_GETDOCPOINTER, 0, 0));
- l_setglobalview(lua, view);
lL_event(lua, "view_new", -1);
return view;
}
diff --git a/themes/dark.lua b/themes/dark.lua
new file mode 100644
index 00000000..45764062
--- /dev/null
+++ b/themes/dark.lua
@@ -0,0 +1,118 @@
+-- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
+-- Dark theme for Textadept.
+-- Contributions by Ana Balan.
+
+local buffer = buffer
+local property, property_int = buffer.property, buffer.property_int
+
+-- Greyscale colors.
+--property['color.dark_black'] = 0x000000
+property['color.black'] = 0x1A1A1A
+property['color.light_black'] = 0x333333
+--property['color.grey_black'] = 0x4D4D4D
+property['color.dark_grey'] = 0x666666
+property['color.grey'] = 0x808080
+property['color.light_grey'] = 0x999999
+--property['color.grey_white'] = 0xB3B3B3
+property['color.dark_white'] = 0xCCCCCC
+--property['color.white'] = 0xE6E6E6
+--property['color.light_white'] = 0xFFFFFF
+
+-- Dark colors.
+--property['color.dark_red'] = 0x1A1A66
+--property['color.dark_yellow'] = 0x1A6666
+--property['color.dark_green'] = 0x1A661A
+--property['color.dark_teal'] = 0x66661A
+--property['color.dark_purple'] = 0x661A66
+--property['color.dark_orange'] = 0x1A66B3
+--property['color.dark_pink'] = 0x6666B3
+--property['color.dark_lavender'] = 0xB36666
+--property['color.dark_blue'] = 0xB3661A
+
+-- Normal colors.
+property['color.red'] = 0x4D4D99
+property['color.yellow'] = 0x4D9999
+property['color.green'] = 0x4D994D
+property['color.teal'] = 0x99994D
+property['color.purple'] = 0x994D99
+property['color.orange'] = 0x4D99E6
+--property['color.pink'] = 0x9999E6
+property['color.lavender'] = 0xE69999
+property['color.blue'] = 0xE6994D
+
+-- Light colors.
+property['color.light_red'] = 0x8080CC
+property['color.light_yellow'] = 0x80CCCC
+property['color.light_green'] = 0x80CC80
+--property['color.light_teal'] = 0xCCCC80
+--property['color.light_purple'] = 0xCC80CC
+--property['color.light_orange'] = 0x80CCFF
+--property['color.light_pink'] = 0xCCCCFF
+--property['color.light_lavender'] = 0xFFCCCC
+property['color.light_blue'] = 0xFFCC80
+
+-- Default style.
+local font, size = 'Bitstream Vera Sans Mono', 10
+if WIN32 then
+ font = 'Courier New'
+elseif OSX then
+ font, size = 'Monaco', 12
+end
+property['style.default'] = 'font:'..font..',size:'..size..
+ ',fore:$(color.light_grey),back:$(color.black)'
+
+-- Token styles.
+property['style.nothing'] = ''
+property['style.class'] = 'fore:$(color.light_yellow)'
+property['style.comment'] = 'fore:$(color.dark_grey)'
+property['style.constant'] = 'fore:$(color.red)'
+property['style.error'] = 'fore:$(color.red),italics'
+property['style.function'] = 'fore:$(color.blue)'
+property['style.keyword'] = 'fore:$(color.dark_white)'
+property['style.label'] = 'fore:$(color.orange)'
+property['style.number'] = 'fore:$(color.teal)'
+property['style.operator'] = 'fore:$(color.yellow)'
+property['style.regex'] = 'fore:$(color.light_green)'
+property['style.string'] = 'fore:$(color.green)'
+property['style.preprocessor'] = 'fore:$(color.purple)'
+property['style.type'] = 'fore:$(color.lavender)'
+property['style.variable'] = 'fore:$(color.light_blue)'
+property['style.whitespace'] = ''
+property['style.embedded'] = '$(style.tag),back:$(color.light_black)'
+property['style.identifier'] = '$(style.nothing)'
+
+-- Predefined styles.
+property['style.linenumber'] = 'fore:$(color.dark_grey),back:$(color.black)'
+property['style.bracelight'] = 'fore:$(color.light_blue)'
+property['style.bracebad'] = 'fore:$(color.light_red)'
+property['style.controlchar'] = '$(style.nothing)'
+property['style.indentguide'] = 'fore:$(color.light_black)'
+property['style.calltip'] = 'fore:$(color.light_grey),back:$(color.light_black)'
+
+-- Multiple Selection and Virtual Space
+--buffer.additional_sel_alpha =
+--buffer.additional_sel_fore =
+--buffer.additional_sel_back =
+--buffer.additional_caret_fore =
+
+-- Caret and Selection Styles.
+buffer:set_sel_fore(true, property_int['color.light_black'])
+buffer:set_sel_back(true, property_int['color.grey'])
+--buffer.sel_alpha =
+buffer.caret_fore = property_int['color.grey']
+buffer.caret_line_back = property_int['color.light_black']
+--buffer.caret_line_back_alpha =
+
+-- Fold Margin.
+buffer:set_fold_margin_colour(true, property_int['color.black'])
+buffer:set_fold_margin_hi_colour(true, property_int['color.black'])
+
+-- Fold Margin Markers.
+local c = _SCINTILLA.constants
+buffer.marker_fore[c.SC_MARKNUM_FOLDEROPEN] = property_int['color.dark_grey']
+buffer.marker_back[c.SC_MARKNUM_FOLDEROPEN] = property_int['color.dark_grey']
+buffer.marker_fore[c.SC_MARKNUM_FOLDER] = property_int['color.dark_grey']
+buffer.marker_back[c.SC_MARKNUM_FOLDER] = property_int['color.dark_grey']
+
+-- Long Lines.
+buffer.edge_colour = property_int['color.dark_grey']
diff --git a/themes/dark/buffer.lua b/themes/dark/buffer.lua
deleted file mode 100644
index 2dfa07b2..00000000
--- a/themes/dark/buffer.lua
+++ /dev/null
@@ -1,16 +0,0 @@
--- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
--- Dark 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/dark/lexer.lua b/themes/dark/lexer.lua
deleted file mode 100644
index 4824fb8c..00000000
--- a/themes/dark/lexer.lua
+++ /dev/null
@@ -1,100 +0,0 @@
--- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
--- Dark lexer theme for Textadept.
--- Contributions by Ana Balan.
-
--- 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.
-
-local l, color, style = lexer, lexer.color, lexer.style
-
-l.colors = {
- -- 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'),
-}
-
-l.style_nothing = style{ }
-l.style_class = style{fore = l.colors.light_yellow }
-l.style_comment = style{fore = l.colors.dark_grey }
-l.style_constant = style{fore = l.colors.red }
-l.style_definition = style{fore = l.colors.light_yellow }
-l.style_error = style{fore = l.colors.red, italic = true}
-l.style_function = style{fore = l.colors.blue }
-l.style_keyword = style{fore = l.colors.dark_white }
-l.style_label = style{fore = l.colors.orange }
-l.style_number = style{fore = l.colors.teal }
-l.style_operator = style{fore = l.colors.yellow }
-l.style_regex = style{fore = l.colors.light_green }
-l.style_string = style{fore = l.colors.green }
-l.style_preproc = style{fore = l.colors.purple }
-l.style_tag = style{fore = l.colors.dark_white }
-l.style_type = style{fore = l.colors.lavender }
-l.style_variable = style{fore = l.colors.light_blue }
-l.style_whitespace = style{ }
-l.style_embedded = l.style_tag..{back = l.colors.light_black}
-l.style_identifier = l.style_nothing
-
--- Default styles.
-local font_face = 'Bitstream Vera Sans Mono'
-local font_size = 10
-if WIN32 then
- font_face = 'Courier New'
-elseif OSX then
- font_face = 'Monaco'
- font_size = 12
-end
-l.style_default = style{
- font = font_face, size = font_size,
- fore = l.colors.light_grey, back = l.colors.black
-}
-l.style_line_number = style{fore = l.colors.dark_grey, back = l.colors.black}
-l.style_bracelight = style{fore = l.colors.light_blue}
-l.style_bracebad = style{fore = l.colors.light_red}
-l.style_controlchar = l.style_nothing
-l.style_indentguide = style{
- fore = l.colors.light_black, back = l.colors.light_black
-}
-l.style_calltip = style{fore = l.colors.light_grey, back = l.colors.light_black}
diff --git a/themes/light.lua b/themes/light.lua
new file mode 100644
index 00000000..6ea1a292
--- /dev/null
+++ b/themes/light.lua
@@ -0,0 +1,118 @@
+-- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
+-- Light theme for Textadept.
+-- Contributions by Ana Balan.
+
+local buffer = buffer
+local property, property_int = buffer.property, buffer.property_int
+
+-- Greyscale colors.
+--property['color.dark_black'] = 0x000000
+--property['color.black'] = 0x1A1A1A
+property['color.light_black'] = 0x333333
+property['color.grey_black'] = 0x4D4D4D
+--property['color.dark_grey'] = 0x666666
+property['color.grey'] = 0x808080
+property['color.light_grey'] = 0x999999
+--property['color.grey_white'] = 0xB3B3B3
+property['color.dark_white'] = 0xCCCCCC
+property['color.white'] = 0xE6E6E6
+--property['color.light_white'] = 0xFFFFFF
+
+-- Dark colors.
+--property['color.dark_red'] = 0x1A1A66
+property['color.dark_yellow'] = 0x1A6666
+property['color.dark_green'] = 0x1A661A
+--property['color.dark_teal'] = 0x66661A
+--property['color.dark_purple'] = 0x661A66
+property['color.dark_orange'] = 0x1A66B3
+--property['color.dark_pink'] = 0x6666B3
+property['color.dark_lavender'] = 0xB36666
+property['color.dark_blue'] = 0xB3661A
+
+-- Normal colors.
+property['color.red'] = 0x4D4D99
+property['color.yellow'] = 0x4D9999
+property['color.green'] = 0x4D994D
+property['color.teal'] = 0x99994D
+property['color.purple'] = 0x994D99
+property['color.orange'] = 0x4D99E6
+--property['color.pink'] = 0x9999E6
+property['color.lavender'] = 0xE69999
+--property['color.blue'] = 0xE6994D
+
+-- Light colors.
+property['color.light_red'] = 0x8080CC
+--property['color.light_yellow'] = 0x80CCCC
+--property['color.light_green'] = 0x80CC80
+--property['color.light_teal'] = 0xCCCC80
+--property['color.light_purple'] = 0xCC80CC
+--property['color.light_orange'] = 0x80CCFF
+--property['color.light_pink'] = 0xCCCCFF
+--property['color.light_lavender'] = 0xFFCCCC
+property['color.light_blue'] = 0xFFCC80
+
+-- Default style.
+local font, size = 'Bitstream Vera Sans Mono', 10
+if WIN32 then
+ font = 'Courier New'
+elseif OSX then
+ font, size = 'Monaco', 12
+end
+property['style.default'] = 'font:'..font..',size:'..size..
+ ',fore:$(color.light_black),back:$(color.white)'
+
+-- Token styles.
+property['style.nothing'] = ''
+property['style.class'] = 'fore:$(color.yellow)'
+property['style.comment'] = 'fore:$(color.grey)'
+property['style.constant'] = 'fore:$(color.red)'
+property['style.error'] = 'fore:$(color.red),italics'
+property['style.function'] = 'fore:$(color.dark_orange)'
+property['style.keyword'] = 'fore:$(color.dark_blue)'
+property['style.label'] = 'fore:$(color.dark_orange)'
+property['style.number'] = 'fore:$(color.teal)'
+property['style.operator'] = 'fore:$(color.purple)'
+property['style.regex'] = 'fore:$(color.dark_green)'
+property['style.string'] = 'fore:$(color.green)'
+property['style.preprocessor'] = 'fore:$(color.dark_yellow)'
+property['style.type'] = 'fore:$(color.lavender)'
+property['style.variable'] = 'fore:$(color.dark_lavender)'
+property['style.whitespace'] = ''
+property['style.embedded'] = '$(style.tag),back:$(color.dark_white)'
+property['style.identifier'] = '$(style.nothing)'
+
+-- Predefined styles.
+property['style.linenumber'] = 'fore:$(color.grey),back:$(color.white)'
+property['style.bracelight'] = 'fore:$(color.light_blue)'
+property['style.bracebad'] = 'fore:$(color.light_red)'
+property['style.controlchar'] = '$(style.nothing)'
+property['style.indentguide'] = 'fore:$(color.dark_white)'
+property['style.calltip'] = 'fore:$(color.light_black),back:$(color.dark_white)'
+
+-- Multiple Selection and Virtual Space
+--buffer.additional_sel_alpha =
+--buffer.additional_sel_fore =
+--buffer.additional_sel_back =
+--buffer.additional_caret_fore =
+
+-- Caret and Selection Styles.
+buffer:set_sel_fore(true, property_int['color.light_black'])
+buffer:set_sel_back(true, property_int['color.light_grey'])
+--buffer.sel_alpha =
+buffer.caret_fore = property_int['color.grey_black']
+buffer.caret_line_back = property_int['color.dark_white']
+--buffer.caret_line_back_alpha =
+
+-- Fold Margin.
+buffer:set_fold_margin_colour(true, property_int['color.white'])
+buffer:set_fold_margin_hi_colour(true, property_int['color.white'])
+
+-- Fold Margin Markers.
+local c = _SCINTILLA.constants
+buffer.marker_fore[c.SC_MARKNUM_FOLDEROPEN] = property_int['color.grey']
+buffer.marker_back[c.SC_MARKNUM_FOLDEROPEN] = property_int['color.grey']
+buffer.marker_fore[c.SC_MARKNUM_FOLDER] = property_int['color.grey']
+buffer.marker_back[c.SC_MARKNUM_FOLDER] = property_int['color.grey']
+
+-- Long Lines.
+buffer.edge_colour = property_int['color.grey']
diff --git a/themes/light/buffer.lua b/themes/light/buffer.lua
deleted file mode 100644
index e86af33a..00000000
--- a/themes/light/buffer.lua
+++ /dev/null
@@ -1,16 +0,0 @@
--- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
--- Light 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/light/lexer.lua b/themes/light/lexer.lua
deleted file mode 100644
index 5865e363..00000000
--- a/themes/light/lexer.lua
+++ /dev/null
@@ -1,99 +0,0 @@
--- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
--- Light 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.
-
-local l, color, style = lexer, lexer.color, lexer.style
-
-l.colors = {
- -- 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'),
-}
-
-l.style_nothing = style{ }
-l.style_class = style{fore = l.colors.yellow }
-l.style_comment = style{fore = l.colors.grey }
-l.style_constant = style{fore = l.colors.red }
-l.style_definition = style{fore = l.colors.yellow }
-l.style_error = style{fore = l.colors.red, italic = true}
-l.style_function = style{fore = l.colors.dark_orange }
-l.style_keyword = style{fore = l.colors.dark_blue }
-l.style_label = style{fore = l.colors.dark_orange }
-l.style_number = style{fore = l.colors.teal }
-l.style_operator = style{fore = l.colors.purple }
-l.style_regex = style{fore = l.colors.dark_green }
-l.style_string = style{fore = l.colors.green }
-l.style_preproc = style{fore = l.colors.dark_yellow }
-l.style_tag = style{fore = l.colors.dark_blue }
-l.style_type = style{fore = l.colors.lavender }
-l.style_variable = style{fore = l.colors.dark_lavender }
-l.style_whitespace = style{ }
-l.style_embedded = l.style_tag..{back = l.colors.dark_white}
-l.style_identifier = l.style_nothing
-
--- Default styles.
-local font_face = 'Bitstream Vera Sans Mono'
-local font_size = 10
-if WIN32 then
- font_face = 'Courier New'
-elseif OSX then
- font_face = 'Monaco'
- font_size = 12
-end
-l.style_default = style{
- font = font_face, size = font_size,
- fore = l.colors.light_black, back = l.colors.white
-}
-l.style_line_number = style{fore = l.colors.grey, back = l.colors.white}
-l.style_bracelight = style{fore = l.colors.light_blue}
-l.style_bracebad = style{fore = l.colors.light_red}
-l.style_controlchar = l.style_nothing
-l.style_indentguide = style{
- fore = l.colors.dark_white, back = l.colors.dark_white
-}
-l.style_calltip = style{fore = l.colors.light_black, back = l.colors.dark_white}
diff --git a/themes/light/view.lua b/themes/light/view.lua
deleted file mode 100644
index edb72b11..00000000
--- a/themes/light/view.lua
+++ /dev/null
@@ -1,124 +0,0 @@
--- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
--- Light 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 = c.SC_MULTIPASTE_EACH
---buffer.virtual_space_options = c.SCVS_RECTANGULARSELECTION +
--- c.SCVS_USERACCESSIBLE
-buffer.rectangular_selection_modifier = (WIN32 or OSX) and c.SCMOD_ALT or
- c.SCMOD_SUPER
---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 = c.SCWS_VISIBLEALWAYS
---buffer.whitespace_size =
---buffer.extra_ascent =
---buffer.extra_descent =
-
--- Line Endings
---buffer.view_eol = true
-
--- Caret and Selection Styles.
-buffer:set_sel_fore(true, 0x333333)
-buffer:set_sel_back(true, 0x999999)
---buffer.sel_alpha =
---buffer.sel_eol_filled = true
-buffer.caret_fore = 0x4D4D4D
-buffer.caret_line_visible = true
---buffer.caret_line_visible_always = true
-buffer.caret_line_back = 0xCCCCCC
---buffer.caret_line_back_alpha =
---buffer.caret_period = 0
---buffer.caret_style = c.CARETSTYLE_BLOCK
---buffer.caret_width =
---buffer.caret_sticky = c.SC_CARETSTICKY_ON
-
--- 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 -- marker margin invisible
-
--- Fold Margin.
-buffer.margin_type_n[2] = c.SC_MARGIN_SYMBOL
-buffer.margin_width_n[2] = 10
-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(true, 0xE6E6E6)
-buffer:set_fold_margin_hi_colour(true, 0xE6E6E6)
-
--- Annotations.
-buffer.annotation_visible = c.ANNOTATION_BOXED
-
--- Other.
-buffer.buffered_draw = not OSX -- Quartz buffers drawing
---buffer.two_phase_draw = false
-
--- Indentation Guides.
-buffer.indentation_guides = c.SC_IV_LOOKBOTH
-
--- Fold Margin Markers.
-buffer:marker_define(c.SC_MARKNUM_FOLDEROPEN, c.SC_MARK_ARROWDOWN)
-buffer.marker_fore[c.SC_MARKNUM_FOLDEROPEN] = 0x808080
-buffer.marker_back[c.SC_MARKNUM_FOLDEROPEN] = 0x808080
-buffer:marker_define(c.SC_MARKNUM_FOLDER, c.SC_MARK_ARROW)
-buffer.marker_fore[c.SC_MARKNUM_FOLDER] = 0x808080
-buffer.marker_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)
-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 =
-
--- Folding.
-buffer.fold_flags = c.SC_FOLDFLAG_LINEAFTER_CONTRACTED
-buffer.automatic_fold = c.SC_AUTOMATICFOLD_SHOW + c.SC_AUTOMATICFOLD_CLICK +
- c.SC_AUTOMATICFOLD_CHANGE
-
--- Line Wrapping.
---buffer.wrap_mode = c.SC_WRAP_WORD
---buffer.wrap_visual_flags = c.SC_WRAPVISUALFLAG_MARGIN
---buffer.wrap_visual_flags_location = c.SC_WRAPVISUALFLAGLOC_END_BY_TEXT
---buffer.wrap_indent_mode = c.SC_WRAPINDENT_SAME
---buffer.wrap_start_indent =
-
--- Long Lines.
---buffer.edge_mode = c.EDGE_LINE
---buffer.edge_column = 80
---buffer.edge_colour = 0x808080
-
--- Notifications.
-buffer.mod_event_mask = c.SC_MOD_CHANGEFOLD
diff --git a/themes/term.lua b/themes/term.lua
new file mode 100644
index 00000000..23d06678
--- /dev/null
+++ b/themes/term.lua
@@ -0,0 +1,80 @@
+-- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
+-- Terminal theme for Textadept.
+-- Contributions by Ana Balan.
+
+local buffer = buffer
+local property, property_int = buffer.property, buffer.property_int
+
+-- Normal colors.
+property['color.black'] = 0x000000
+property['color.red'] = 0x000080
+property['color.green'] = 0x008000
+property['color.yellow'] = 0x008080
+property['color.blue'] = 0x800000
+property['color.magenta'] = 0x800080
+property['color.cyan'] = 0x808000
+property['color.white'] = 0xC0C0C0
+
+-- 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'] = 0x404040
+property['color.light_red'] = 0x0000FF
+property['color.light_green'] = 0x00FF00
+property['color.light_yellow'] = 0x00FFFF
+property['color.light_blue'] = 0xFF0000
+property['color.light_magenta'] = 0xFF00FF
+property['color.light_cyan'] = 0xFFFF00
+property['color.light_white'] = 0xFFFFFF
+
+-- Default style.
+property['style.default'] = 'fore:$(color.white),back:$(color.black)'
+
+-- Token styles.
+property['style.nothing'] = ''
+property['style.class'] = 'fore:$(color.yellow)'
+property['style.comment'] = 'fore:$(color.black),bold'
+property['style.constant'] = 'fore:$(color.red)'
+property['style.error'] = 'fore:$(color.red),bold'
+property['style.function'] = 'fore:$(color.blue)'
+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.regex'] = 'fore:$(color.green),bold'
+property['style.string'] = 'fore:$(color.green)'
+property['style.preprocessor'] = 'fore:$(color.magenta)'
+property['style.type'] = 'fore:$(color.magenta),bold'
+property['style.variable'] = 'fore:$(color.blue),bold'
+property['style.whitespace'] = ''
+property['style.embedded'] = '$(style.tag),back:$(color.black),bold'
+property['style.identifier'] = '$(style.nothing)'
+
+-- Predefined styles.
+property['style.linenumber'] = '$(style.default)'
+property['style.bracelight'] = 'fore:$(color.black),back:$(color.white)'
+property['style.bracebad'] = 'fore:$(color.red),bold'
+property['style.controlchar'] = '$(style.nothing)'
+property['style.indentguide'] = '$(style.nothing)'
+property['style.calltip'] = '$(style.default)'
+
+-- Multiple Selection and Virtual Space
+--buffer.additional_sel_alpha =
+--buffer.additional_sel_fore =
+--buffer.additional_sel_back =
+--buffer.additional_caret_fore =
+
+-- Caret and Selection Styles.
+--buffer:set_sel_fore(true, property_int['color.white'])
+--buffer:set_sel_back(true, property_int['color.black'])
+--buffer.sel_alpha =
+--buffer.caret_fore = property_int['color.black']
+--buffer.caret_line_back =
+--buffer.caret_line_back_alpha =
+
+-- Fold Margin.
+--buffer:set_fold_margin_colour(true, property_int['color.white'])
+--buffer:set_fold_margin_hi_colour(true, property_int['color.white'])
+
+-- Long Lines.
+buffer.edge_colour = property_int['color.white']
diff --git a/themes/term/buffer.lua b/themes/term/buffer.lua
deleted file mode 100644
index 6b55911a..00000000
--- a/themes/term/buffer.lua
+++ /dev/null
@@ -1,16 +0,0 @@
--- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
--- Terminal 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/term/lexer.lua b/themes/term/lexer.lua
deleted file mode 100644
index 40e570c1..00000000
--- a/themes/term/lexer.lua
+++ /dev/null
@@ -1,63 +0,0 @@
--- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
--- Terminal lexer theme for Textadept.
--- Contributions by Ana Balan.
-
--- 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.
-
-local l, color, style = lexer, lexer.color, lexer.style
-
-l.colors = {
- -- Normal colors.
- black = color('00', '00', '00'),
- red = color('80', '00', '00'),
- green = color('00', '80', '00'),
- yellow = color('80', '80', '00'),
- blue = color('00', '00', '80'),
- magenta = color('80', '00', '80'),
- cyan = color('00', '80', '80'),
- white = color('C0', 'C0', 'C0'),
-
- -- 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.
- light_black = color('40', '40', '40'),
- light_red = color('FF', '00', '00'),
- light_green = color('00', 'FF', '00'),
- light_yellow = color('FF', 'FF', '00'),
- light_blue = color('00', '00', 'FF'),
- light_magenta = color('FF', '00', 'FF'),
- light_cyan = color('00', 'FF', 'FF'),
- light_white = color('FF', 'FF', 'FF'),
-}
-
-l.style_nothing = style{ }
-l.style_class = style{fore = l.colors.yellow, bold = true }
-l.style_comment = style{fore = l.colors.black, bold = true }
-l.style_constant = style{fore = l.colors.red }
-l.style_definition = style{fore = l.colors.yellow, bold = true }
-l.style_error = style{fore = l.colors.red, bold = true }
-l.style_function = style{fore = l.colors.blue }
-l.style_keyword = style{fore = l.colors.white, bold = true }
-l.style_label = style{fore = l.colors.red, bold = true }
-l.style_number = style{fore = l.colors.cyan }
-l.style_operator = style{fore = l.colors.yellow }
-l.style_regex = style{fore = l.colors.green, bold = true }
-l.style_string = style{fore = l.colors.green }
-l.style_preproc = style{fore = l.colors.magenta }
-l.style_tag = style{fore = l.colors.white, bold = true }
-l.style_type = style{fore = l.colors.magenta, bold = true}
-l.style_variable = style{fore = l.colors.blue, bold = true }
-l.style_whitespace = l.style_nothing
-l.style_embedded = l.style_tag..{back = l.colors.black, bold = true}
-l.style_identifier = l.style_nothing
-
--- Default styles.
-l.style_default = style{fore = l.colors.white, back = l.colors.black}
-l.style_line_number = l.style_default
-l.style_bracelight = style{fore = l.colors.black, back = l.colors.white}
-l.style_bracebad = style{fore = l.colors.red, bold = true}
-l.style_controlchar = l.style_nothing
-l.style_indentguide = l.style_nothing
-l.style_calltip = l.style_default
diff --git a/themes/term/view.lua b/themes/term/view.lua
deleted file mode 100644
index 1a3b32d1..00000000
--- a/themes/term/view.lua
+++ /dev/null
@@ -1,122 +0,0 @@
--- Copyright 2007-2013 Mitchell mitchell.att.foicica.com. See LICENSE.
--- Terminal 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 = c.SC_MULTIPASTE_EACH
---buffer.virtual_space_options = c.SCVS_RECTANGULARSELECTION +
--- c.SCVS_USERACCESSIBLE
---buffer.rectangular_selection_modifier = c.SCMOD_SUPER
---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 = true
---buffer.v_scroll_bar = true
---buffer.x_offset =
---buffer.scroll_width =
---buffer.scroll_width_tracking = true
---buffer.end_at_last_line = false
-
--- Whitespace
---buffer.view_ws = c.SCWS_VISIBLEALWAYS
---buffer.whitespace_size =
---buffer.extra_ascent =
---buffer.extra_descent =
-
--- Line Endings
---buffer.view_eol = true
-
--- Caret and Selection Styles.
---buffer:set_sel_fore(true, 0xFFFFFF)
---buffer:set_sel_back(true, 0x000000)
---buffer.sel_alpha =
---buffer.sel_eol_filled = true
---buffer.caret_fore = 0x000000
---buffer.caret_line_visible = true
---buffer.caret_line_visible_always = true
---buffer.caret_line_back =
---buffer.caret_line_back_alpha =
---buffer.caret_period = 500
---buffer.caret_style = c.CARETSTYLE_LINE
---buffer.caret_width =
---buffer.caret_sticky = c.SC_CARETSTICKY_ON
-
--- Line Number Margin.
-buffer.margin_width_n[0] = 4
-
--- Marker Margin.
---buffer.margin_width_n[1] = 0 -- marker margin invisible
-
--- Fold Margin.
---buffer.margin_type_n[2] =
-buffer.margin_width_n[2] = 1
-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(true, 0xFFFFFF)
---buffer:set_fold_margin_hi_colour(true, 0xFFFFFF)
-
--- Annotations.
-buffer.annotation_visible = c.ANNOTATION_BOXED
-
--- Other.
---buffer.buffered_draw = true
---buffer.two_phase_draw = true
-
--- Indentation Guides.
---buffer.indentation_guides = c.SC_IV_LOOKBOTH
-
--- Fold Margin Markers.
---buffer:marker_define(c.SC_MARKNUM_FOLDERSUB,
--- c.SC_MARK_CHARACTER + string.byte('_'))
---buffer:marker_define(c.SC_MARKNUM_FOLDERTAIL,
--- c.SC_MARK_CHARACTER + string.byte('L'))
---buffer:marker_define(c.SC_MARKNUM_FOLDEREND,
--- c.SC_MARK_CHARACTER + string.byte('+'))
---buffer:marker_define(c.SC_MARKNUM_FOLDEROPENMID,
--- c.SC_MARK_CHARACTER + string.byte('+'))
---buffer:marker_define(c.SC_MARKNUM_FOLDERMIDTAIL,
--- c.SC_MARK_CHARACTER + string.byte('t'))
-
--- 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 =
-
--- Folding.
---buffer.fold_flags = c.SC_FOLDFLAG_LINEAFTER_CONTRACTED
-buffer.automatic_fold = c.SC_AUTOMATICFOLD_SHOW + c.SC_AUTOMATICFOLD_CLICK +
- c.SC_AUTOMATICFOLD_CHANGE
-
--- Line Wrapping.
---buffer.wrap_mode = c.SC_WRAP_WORD
---buffer.wrap_visual_flags = c.SC_WRAPVISUALFLAG_MARGIN
---buffer.wrap_visual_flags_location = c.SC_WRAPVISUALFLAGLOC_END_BY_TEXT
-buffer.wrap_indent_mode = c.SC_WRAPINDENT_SAME
---buffer.wrap_start_indent =
-
--- Long Lines.
---buffer.edge_mode = c.EDGE_BACKGROUND
---buffer.edge_column = 80
---buffer.edge_colour = 0xFFFFFF
-
--- Notifications.
---buffer.mod_event_mask =