aboutsummaryrefslogtreecommitdiff
path: root/lua
diff options
context:
space:
mode:
Diffstat (limited to 'lua')
-rw-r--r--lua/vis-std.lua5
-rw-r--r--lua/vis.lua2
2 files changed, 3 insertions, 4 deletions
diff --git a/lua/vis-std.lua b/lua/vis-std.lua
index 845785d..86f8f46 100644
--- a/lua/vis-std.lua
+++ b/lua/vis-std.lua
@@ -7,7 +7,7 @@ vis.events.subscribe(vis.events.INIT, function()
vis:command("set theme ".. (vis.ui.colors <= 16 and "default-16" or "default-256"))
end)
-vis.events.subscribe(vis.events.THEME_CHANGE, function(name)
+vis:option_register("theme", "string", function(name)
if name ~= nil then
local theme = 'themes/'..name
package.loaded[theme] = nil
@@ -19,7 +19,8 @@ vis.events.subscribe(vis.events.THEME_CHANGE, function(name)
for win in vis:windows() do
win:set_syntax(win.syntax)
end
-end)
+ return true
+end, "Color theme to use, filename without extension")
vis:option_register("syntax", "string", function(name)
if not vis.win then return false end
diff --git a/lua/vis.lua b/lua/vis.lua
index 9b45483..93a3e5d 100644
--- a/lua/vis.lua
+++ b/lua/vis.lua
@@ -109,7 +109,6 @@ local events = {
INPUT = "Event::INPUT", -- see @{input}
QUIT = "Event::QUIT", -- see @{quit}
START = "Event::START", -- see @{start}
- THEME_CHANGE = "Event::THEME_CHANGE", -- see @{theme_change}
WIN_CLOSE = "Event::WIN_CLOSE", -- see @{win_close}
WIN_HIGHLIGHT = "Event::WIN_HIGHLIGHT", -- see @{win_highlight}
WIN_OPEN = "Event::WIN_OPEN", -- see @{win_open}
@@ -124,7 +123,6 @@ events.init = function(...) events.emit(events.INIT, ...) end
events.input = function(...) return events.emit(events.INPUT, ...) end
events.quit = function(...) events.emit(events.QUIT, ...) end
events.start = function(...) events.emit(events.START, ...) end
-events.theme_change = function(...) events.emit(events.THEME_CHANGE, ...) end
events.win_close = function(...) events.emit(events.WIN_CLOSE, ...) end
events.win_highlight = function(...) events.emit(events.WIN_HIGHLIGHT, ...) end
events.win_open = function(...) events.emit(events.WIN_OPEN, ...) end