diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-05-04 17:42:18 +0200 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-05-04 17:45:11 +0200 |
| commit | b2800904b8cb8269c0e750dced51e8dc422af8f5 (patch) | |
| tree | c6174f3cc21a06b69f3c40dbd49710e3ed9ce103 /vis.lua | |
| parent | b04b66e0ab5646342241b2535768337d9d12a93a (diff) | |
| download | vis-b2800904b8cb8269c0e750dced51e8dc422af8f5.tar.gz vis-b2800904b8cb8269c0e750dced51e8dc422af8f5.tar.xz | |
vis-lua: reload all lexers after theme change
Close #221
Diffstat (limited to 'vis.lua')
| -rw-r--r-- | vis.lua | 16 |
1 files changed, 16 insertions, 0 deletions
@@ -201,3 +201,19 @@ vis.filetype_detect = function(win) win.syntax = nil end +vis.events.theme_change = function(name) + if name ~= nil then + local theme = 'themes/'..name + package.loaded[theme] = nil + require(theme) + end + + if vis.lexers ~= nil then + vis.lexers.lexers = {} + end + + for win in vis:windows() do + win.syntax = win.syntax; + end +end + |
