mirror of
https://github.com/folke/lazy.nvim.git
synced 2025-06-28 03:24:13 +00:00
fix(cache): reload file if compiled code is incompatible. Fixes #225
This commit is contained in:
parent
4e3a973f85
commit
b8c5ab5dae
1 changed files with 4 additions and 1 deletions
|
@ -158,7 +158,10 @@ function M.load(modkey, modpath)
|
||||||
entry.used = os.time()
|
entry.used = os.time()
|
||||||
if M.eq(entry.hash, hash) then
|
if M.eq(entry.hash, hash) then
|
||||||
-- found in cache and up to date
|
-- found in cache and up to date
|
||||||
return loadstring(entry.chunk --[[@as string]], "@" .. entry.modpath)
|
local chunk, err = loadstring(entry.chunk --[[@as string]], "@" .. entry.modpath)
|
||||||
|
if not (err and err:find("cannot load incompatible bytecode", 1, true)) then
|
||||||
|
return chunk, err
|
||||||
|
end
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
entry = { hash = hash, modpath = modpath, used = os.time() }
|
entry = { hash = hash, modpath = modpath, used = os.time() }
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue