martanne / vis

A vi-like editor based on Plan 9's structural regular expressions
Other
4.23k stars 256 forks source link

Time event #879

Closed erf closed 1 year ago

erf commented 3 years ago

I would like to perform a custom command at spesific time intervals, but it doesn't seem like Lua support this type of operation. Would it make sense to add support for this in the vis editor, perhaps extend the Lua API?

Example API:

Vis:time(ms) fire a TIME event in a given time, which you could subscribe to:

vis.events.subscribe(vis.events.TIME, function(id)
    -- do something useful
    return true
end)