diff options
Diffstat (limited to 'script-beta')
-rw-r--r-- | script-beta/files.lua | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/script-beta/files.lua b/script-beta/files.lua index f1e1de91..ead75079 100644 --- a/script-beta/files.lua +++ b/script-beta/files.lua @@ -358,10 +358,25 @@ function m.flushCache() for _, file in pairs(m.fileMap) do file.cacheActiveTime = math.huge file.ast = nil + file.lines = nil file.cache = {} end end +function m.flushFileCache(uri) + if platform.OS == 'Windows' then + uri = uri:lower() + end + local file = m.fileMap[uri] + if not file then + return + end + file.cacheActiveTime = math.huge + file.ast = nil + file.lines = nil + file.cache = {} +end + local function init() --TODO 可以清空文件缓存,之后看要不要启用吧 --timer.loop(10, function () |