diff options
| author | Marc André Tanner <mat@brain-dump.org> | 2016-12-08 09:06:01 +0100 |
|---|---|---|
| committer | Marc André Tanner <mat@brain-dump.org> | 2016-12-08 09:11:59 +0100 |
| commit | 6d1d45776b231304b0ff41b5e6098f07931ec44e (patch) | |
| tree | 2f7f41170491200d5da92bf4cd570a3e268fbed2 /lua/visrc.lua | |
| parent | 065a804d282ac99dd93e9ebaf7bc986ccf53e75b (diff) | |
| download | vis-6d1d45776b231304b0ff41b5e6098f07931ec44e.tar.gz vis-6d1d45776b231304b0ff41b5e6098f07931ec44e.tar.xz | |
lua: add simple event multiplexing mechanism
The editor core calls into the functions registered in the `vis.events`
table which then multiplex the events to all registered event handlers.
The first handler which returns a non `nil` value terminates event
propagation.
Diffstat (limited to 'lua/visrc.lua')
| -rw-r--r-- | lua/visrc.lua | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/lua/visrc.lua b/lua/visrc.lua index 4c44f6a..1a304b4 100644 --- a/lua/visrc.lua +++ b/lua/visrc.lua @@ -3,15 +3,12 @@ require('vis') require('plugins/filetype') require('plugins/textobject-lexer') -vis.events.start = function() +vis.events.subscribe(vis.events.START, function() -- Your global configuration options e.g. -- vis:command('map! normal j gj') -end - -vis.events.win_open = function(win) - -- enable syntax highlighting for known file types - vis.filetype_detect(win) +end) +vis.events.subscribe(vis.events.WIN_OPEN, function(win) -- Your per window configuration options e.g. -- vis:command('set number') -end +end) |
