Skip to content

Commit

Permalink
feat(cache): remove any mentions of lazy. Move the cache to cache/lua…
Browse files Browse the repository at this point in the history
…c instead of cache/lazy/luac
  • Loading branch information
folke committed Mar 14, 2023
1 parent 1a34636 commit 49dda87
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lua/lazy/core/cache.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@ local M = {}
---@field paths? string[] Extra paths to search for modname

M.VERSION = 2
M.path = vim.fn.stdpath("cache") .. "/lazy/luac"
M.path = vim.fn.stdpath("cache") .. "/luac"
M.enabled = false
---@type table<string, {total:number, time:number, [string]:number?}?>
M.stats = {
find = { total = 0, time = 0, not_found = 0 },
}
Expand Down Expand Up @@ -147,7 +148,7 @@ function Cache.loader(modname)
return chunk or error(err)
end
M.track("loader", start)
return "\nlazy_loader: module " .. modname .. " not found"
return "\ncache_loader: module " .. modname .. " not found"
end

-- The `package.loaders` loader for libs
Expand All @@ -171,7 +172,7 @@ function Cache.loader_lib(modname)
return chunk or error(err)
end
M.track("loader_lib", start)
return "\nlazy_loader_lib: module " .. modname .. " not found"
return "\ncache_loader_lib: module " .. modname .. " not found"
end

-- `loadfile` using the cache
Expand Down Expand Up @@ -347,6 +348,9 @@ function M.enable()
break
end
end
-- TODO: add an autocmd on BufWritePost that checks if its in a /lua folder
-- if thats the case, then reset the plugin path.
-- This will make sure we can properly load new top-level lua modules
end

-- Disables the cache:
Expand Down

0 comments on commit 49dda87

Please sign in to comment.