diff options
| author | Florian Fischer <florian.fischer@muhq.space> | 2024-09-29 18:00:16 +0200 |
|---|---|---|
| committer | Florian Fischer <florian.fischer@muhq.space> | 2024-09-29 18:00:16 +0200 |
| commit | 61f79bb3046e4b548f2a1798abccb7b53e284516 (patch) | |
| tree | 6f035e45d46b4c4d081671c8c460a9344c08c8e0 | |
| parent | dc13dfb5d77ae6c6a34802b4dbf0cac686480587 (diff) | |
| download | vis-inotify-61f79bb3046e4b548f2a1798abccb7b53e284516.tar.gz vis-inotify-61f79bb3046e4b548f2a1798abccb7b53e284516.zip | |
terminate all active watches when vis shuts down
| -rw-r--r-- | init.lua | 8 |
1 files changed, 8 insertions, 0 deletions
@@ -70,4 +70,12 @@ end M.add_recreate_watch = function(file, func, cmd_options) _add_watch(file, func, 'recreate', cmd_options) end + +vis.events.subscribe(vis.events.QUIT, function() + -- Terminate all watches + for k, _ in pairs(watches) do + watches[k] = nil + end +end) + return M |
