Implement directory monitoring using septag/dmon

Use a notification based directory monitoring based on the
septag/dmon lirbary instead of periodically rescan the whole
project's tree.
This commit is contained in:
Francesco Abbate
2021-10-08 21:31:22 +02:00
parent 92362586df
commit 9c43727ebc
14 changed files with 2333 additions and 171 deletions
+3 -2
View File
@@ -3,9 +3,10 @@ local core = require "core"
local config = require "core.config"
local Doc = require "core.doc"
local times = setmetatable({}, { __mode = "k" })
local autoreload_scan_rate = 5
local function update_time(doc)
local info = system.get_file_info(doc.filename)
times[doc] = info.modified
@@ -40,7 +41,7 @@ core.add_thread(function()
end
-- wait for next scan
coroutine.yield(config.project_scan_rate)
coroutine.yield(autoreload_scan_rate)
end
end)