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:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user